Is it possible to have both C and Rust code in a single library (either static or dynamic)? Obviously you can in an executable, but in a lib?
10
4
Replying to @nick_r_cameron
It is structurally possible yes; libraries are generally composed of multiple compilation units. What you would need to do is to construct the .o files from your C, and then get cargo to add them to the linking for your rust crate. I think that'd be the easiest approach.

Aug 2, 2022 ยท 9:29 AM UTC

1
2