Using .c source files with Rust

Is there a standard way to include .c source files?

So far I have used extern "C" { ... } to expose functions by compiling .c to an object file, running rustc until ld throttles with an undefined link, and using the arguments shown after error: linking with 'cc' failed with code 1; note: cc arguments: ... error: linking with 'cc' failed with code 1; note: cc arguments: ... to run cc myobjfile.o ...

+4
source share
1 answer

Luckman made the IRC understand; using extern "C" { ... } with #[link_args="src/source.c"]; The box file works for me.

+4
source

All Articles