Rust not compiling to executable in Linux

Compiling rust on Linux with rustc or cargo build produces a shared library instead of an executable file.

My file manager (thunar) and file command show that file type as shared library.

And the compiled binary can only be executed via terminal by $ /path/to/file or $ cargo run.

That file cannot be executed just by double clicking as other executables can be.

Output from file command:

$ file rust_bin

rust_bin: ELF 64-bit LSB shared object, x86_64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=cb8cd... , with debug_info, not stripped`


#linux #rust

1 Likes2.05 GEEK