What are the different ways of specifying the linking path to FFI libraries in Rust?
问题 Using the below code as an example: extern crate libc; #[link(name = "adder")] extern { fn double_input(input: libc::c_int) -> libc::c_int; } fn main() { let input = 4; let output = unsafe { double_input(input) }; println!("{} * 2 = {}", input, output); } Should #[link(name = "adder")] include a relative path to the .o / a / .h files? For example, should it be #[link(name = "../adderlib/adder")] ? Is there another way to tell the compiler where adder is? 回答1: The answer to the first question