Closed ZingerLittleBee closed 2 years ago
Looks like dynamic linking is not supported. You will need to get a static libpcap.a
library and instruct rustc
from build.rs
to link it statically. You will at least need the following in your build.rs:
println!("cargo:rustc-link-lib=static=pcap");
For more instructions on linking statically, see https://doc.rust-lang.org/cargo/reference/build-scripts.html
Note that provided solution will still fail if LIBPCAP_VER
is unset.
tl;dr this env var short circuits rust-pcap build.rs get_pcap_lib_version
function. If not set said function fails on either lack of shared pcap library or errors out on dlopen as described in initial issue.
First of all, thanks for your contribution. I meet panic like below when pcap build in alpine