hey guys, I am trying ffi, follow this tutorial https://doc.rust-lang.org/nomicon/ffi.html
this is my build.rs in the root of project
fn main() {
println!("cargo:rustc-link-lib=dylib=stdc++"); // This line may be unnecessary for some environments.
// I have tried this, but not working
// println!("cargo:rustc-link-search=/home/steiner/workspace/ffi-examples/snappy-c/");
println!("cargo:rustc-link-search=./snappy-c/");
}
and I clone the snappy-c, ane make it, ln -s libsnappyc.so.1 libsnappy.so
the building is ok, but the running failed, with
target/debug/ffi-examples: error while loading shared libraries: libsnappy.so: cannot open shared object file: No such file or directory
and the ldd shows
steiner@debian-workstation ~/w/ffi-examples (master) [127]> ldd target/debug/ffi-examples
linux-vdso.so.1 (0x00007f2457524000)
libsnappy.so => not found
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2457474000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2457280000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2457526000)
how can I solve it ??