I am a noob to Rust programming. I am getting an error while compiling my first basic Rust program. I presume, I might be making some truly basic mistake. Please advise.
STEPS FOLLOWED:
Installed rustup, rustc, cargo, and Atom editor with ide-rust package.
Logged out and Logged back in.
Created a new package using,
$ cargo new helloworld
Tried compiling the following default program,
fn main() {
println!("Hello, world!");
}
using,
$ rustc main.rs
The following error message is displayed:
error: linking with
cc
failed: exit code: 1
|
= note:"cc"
"-m64"
"-arch"
"x86_64""-L"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib"
"main.main.7rcbfp3g-cgu.0.rcgu.o"
"main.main.7rcbfp3g-cgu.1.rcgu.o"
"main.main.7rcbfp3g-cgu.2.rcgu.o"
"main.main.7rcbfp3g-cgu.3.rcgu.o"
"main.main.7rcbfp3g-cgu.4.rcgu.o"
"main.main.7rcbfp3g-cgu.5.rcgu.o"
"main.main.7rcbfp3g-cgu.6.rcgu.o"
"main.main.7rcbfp3g-cgu.7.rcgu.o""-o"
"main"
"main.4s37gsrti678ik8u.rcgu.o"
"-Wl,-dead_strip"
"-nodefaultlibs""-L"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-349f286494d73b18.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-0c9fcc24a503d489.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-70419d92d1ba4b1d.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-65e88774cb68bd46.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-3849b3781a19a398.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-0dbb03fa66ca6d84.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-65edff8661311c85.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-599e707cd7ee7216.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-40cb05f6c516791a.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-7a0a923a4d37a048.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-7e047938e88325ef.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-02542d835be27c0f.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-63712b18a1365082.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-1196a2a060497e71.rlib"
"/Users/z/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-10db70d883838cbc.rlib""-lSystem"
"-lresolv"
"-lc"
"-lm"= note: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun