Could not exec the linker 'cc': No such file or directory =(

Hello, every body! I have this problem when i try to compile this simple program:

fn main() {
    println!("hello, world!");
}

I'm from Russia and i don't know English very well, so please help me and tell so simple that I can understand.

Thanks!

P. S.
Complier says:

error: could not exec the linker `cc`: No such file or directory (os error 2)
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "test.0.o" "-o" "test" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-f5a209a9.rlib" "/home/dex1cre/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f5a209a9.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"

error: aborting due to previous error

You need to have a C compiler like gcc installed to act as the linker; Rust does not (yet) include its own linker.

If you mention what Linux distro you are on, I can give more specific instructions for how to install a C compiler.

Thanks for the answer! I installed the C compiler and the program was compiled.

i am new, i think rustc stand for rust compiler, and many of tutorials and articles i read do not require me to install any c compiler (or i miss it). So i have the same problem in opensuse, that solved by simply installing gcc. thank you.

Thanks a lots!

I'm at WIndows 10, and got the below error:

error: linker cc not found
|
= note: The system cannot find the file specified. (os error 2)

error: aborting due to previous error

Thanks a lot i ran into this problem to

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.