0

I was writing and building Rust lang last week. I am running rustc 1.54.0 (a178d0322 2021-07-26)

Suddenly I started getting link errors on the hello world propgram created by cargo.

davidtilley@Davids-MacBook-Pro learn % cargo new hw
     Created binary (application) `hw` package
davidtilley@Davids-MacBook-Pro learn % cd hw
davidtilley@Davids-MacBook-Pro hw % cargo build --verbose
   Compiling hw v0.1.0 (/Users/davidtilley/dev/rust/learn/hw)
     Running `rustc --crate-name hw --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=d324b43638469752 --out-dir /Users/davidtilley/dev/rust/learn/hw/target/debug/deps -C incremental=/Users/davidtilley/dev/rust/learn/hw/target/debug/incremental -L dependency=/Users/davidtilley/dev/rust/learn/hw/target/debug/deps`
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.1tqzf16grnkh34kz.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.23dpnoxo0xka8fs0.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.2ay8lapq2ba260xv.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.2yzvclzewauu1ccj.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.329ajawsln1wvgjc.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.3t1f7yntmvefem7f.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.uxrdbue0fo3zpex.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.w5oxau70quiukep.rcgu.o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw.413utlp0j0limcgn.rcgu.o" "-L" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps" "-L" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-7b3af7e771532c4d.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-a312a9d36c2b4585.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-0056ecd921542c45.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-136473faa654159d.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-8948906b8f5e65a2.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-349769333cecb33c.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-2836451a12f8e8a3.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-82701dea42c34fd2.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-b9c0c998e7e580c1.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-b80d5b40251f2607.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-48a685da8003dd08.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-6c310d5e4d35fd71.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-49c2386372f9dd61.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e7ab9cb891a80b09.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-f2fbb54bfcfb6a1f.rlib" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-7f68ec848bc59e6b.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/davidtilley/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/davidtilley/dev/rust/learn/hw/target/debug/deps/hw" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
          

error: aborting due to previous error

error: could not compile `hw`

Caused by:
  process didn't exit successfully: `rustc --crate-name hw --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=d324b43638469752 --out-dir /Users/davidtilley/dev/rust/learn/hw/target/debug/deps -C incremental=/Users/davidtilley/dev/rust/learn/hw/target/debug/incremental -L dependency=/Users/davidtilley/dev/rust/learn/hw/target/debug/deps` (exit status: 1)
mcarton
  • 24,420
  • 5
  • 70
  • 79
onthelake
  • 1
  • 1

0 Answers0