This command outputs executable. rustc has an option --emit obj to output an object file. I believe the format of object file depends on platform. On macOS it's Mach-O format.
Compilation unit in rust is crate, not file, so It seems possible to compile multiple crates and link them in executable with standard linker (like ld), but you also need to link rust std somehow (if you use it).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What is the output of the
command?
Is it executable or is it an object file? If it is an object file, what is the format of it?
It is possible to compile multiple rs files and link them to executable without using cargo?
This command outputs executable.
rustc
has an option--emit obj
to output an object file. I believe the format of object file depends on platform. On macOS it's Mach-O format.Compilation unit in rust is crate, not file, so It seems possible to compile multiple crates and link them in executable with standard linker (like ld), but you also need to link rust std somehow (if you use it).