Install problem, OS-X 10.13.3, helloworld failure


#1

Rust rookie here. Just installed twice, once with curl script, failed, then unistalled and used OSX package. No joy.

rustc --version
rustc 1.6.0 (c30b771ad 2016-01-19)

cat main.rs
fn main() {
println!(“Hello, world!”);
}

rustc main.rs
error: linking with cc failed: exit code: 1
note: “cc” “-m64” “-L” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib” “main.0.o” “-o” “main” “-Wl,-dead_strip” “-nodefaultlibs” “-L” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-ca9f0d77.rlib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcollections-ca9f0d77.rlib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-ca9f0d77.rlib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librand-ca9f0d77.rlib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc-ca9f0d77.rlib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-ca9f0d77.rlib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-ca9f0d77.rlib” “/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcore-ca9f0d77.rlib” “-l” “System” “-l” “pthread” “-l” “c” “-l” “m” “-l” "compiler-rt"
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


#2

Maybe you forget to install xcode commandline tools, use xcode-select --install to install it


#3

That fixed it. Thanks. I don’t remember seeing that step in the instructions.