DEV Community

Discussion on: Calling C code from Rust

Collapse
 
samkevich profile image
Yury Samkevich

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).