[solved] "hello world" won't compile


#1

I just installed 1.2.0 on linux mint. No errors in the install.log. But when I try to compile the hello world program, I get the messages below.

There is a cc compiler visible on my path; am I missing some environment variables?

error: linking with cc failed: exit code: 1
note: “cc” “-Wl,–as-needed” “-m64” “-L” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib” “main.o” “-o” “main” “-Wl,–whole-archive” “-l” “morestack” “-Wl,–no-whole-archive” “-Wl,–gc-sections” “-pie” “-nodefaultlibs” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-62abc69f.rlib” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-62abc69f.rlib” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-62abc69f.rlib” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-62abc69f.rlib” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-62abc69f.rlib” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-62abc69f.rlib” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-62abc69f.rlib” “-L” “/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib” “-L” “/home/kevink/projects/hello/.rust/lib/x86_64-unknown-linux-gnu” “-L” “/home/kevink/projects/hello/lib/x86_64-unknown-linux-gnu” “-Wl,-Bstatic” “-Wl,-Bdynamic” “-l” “dl” “-l” “pthread” “-l” “rt” “-l” “gcc_s” “-l” “pthread” “-l” “c” “-l” “m” “-l” "compiler-rt"
note: /usr/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

error: aborting due to previous error


[Solved] Error compiling "Hello, World" Program
#2

looks relevant. Try installing the build-essential package.


#3

That did it! Thanks.