I do not know how to link a C library to Rust. Here\'s what I have done:
My lib.rs file contains
#[link(name = \"test\")]
extern {
<
I just found a solution (two) but I do not know if it's the best way:
1- way
build.rs file
extern crate gcc;
fn main() {
println!("cargo:rustc-link-search=native=/home/path/to/rust/proyect/folder/contain/file.a");
println!("cargo:rustc-link-lib=static=test");
}
Cargo.toml
//..
build = "build.rs"
//..
2- way
Cargo.toml
//..
rustc-link-search = ["./src/lib"]
rustc-link-lib = ["test"]
root = "/home/path/to/rust/proyect/"
//..
["./src/lib"] -> place to lib.a refence to root