Closed
Description
Problem
I have a project that was originally an application and recently I've decided to make it I also a library. The project uses a build script to link with libpcap. After I added src/lib.rs
, the project stopped building.
When I run cargo with the -v
option, I can see that the lib target gets build just fine but the bin target fails because the linker cannot find some symbols (contents of libpcap). I can also see that the rustc
command for the lib target contains arguments -l static=net_devices -l dylib=pcap
but these arguments are not present for the bin target.
I'd expect all targets to use the output of build.rs.
Steps
- Clone https://github.com/angelcam/arrow-client
- Make sure that libpcap is installed on your system
- Add
src/lib.rs
and - Run
cargo build --features all
Notes
Output of cargo version
:
cargo 1.38.0 (23ef9a4 2019-08-20)