rust-zmq: Undefined reference to `zmq_has', after installing correct bindings for Debian Jessie
What I did:
Installed clean Debian Jessie, needed packages and recommended zmq bindings
apt install libzmq3-dev
And:
cargo build --release
And:
root@osboxes:/home/osboxes/ursadb# ~/.cargo/bin/cargo build --release
Compiling zmq v0.8.2
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/osboxes/ursadb/target/release/build/zmq-711f9aefae80083c/build_script_build-711f9aefae80083c.build_script_build0.rcgu.o" "-o" "/home/osboxes/ursadb/target/release/build/zmq-711f9aefae80083c/build_script_build-711f9aefae80083c" "/home/osboxes/ursadb/target/release/build/zmq-711f9aefae80083c/build_script_build-711f9aefae80083c.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/osboxes/ursadb/target/release/deps" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/osboxes/ursadb/target/release/deps/libzmq_sys-a8aa15e613cdba62.rlib" "/home/osboxes/ursadb/target/release/deps/liblibc-cb2df4011e20c9ce.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cc8b303e3403a89b.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-7ea6f64ea02051fd.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-f1fba9b54042d271.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-46a427bcbb71fa34.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-afe41ccc67b2a14a.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-aac5870ffe4fa74c.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-6a8e7eff29b6cad2.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-a768e53a3f571290.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-016e6e96bb6127b9.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f2b084cc7a7d8bb1.rlib" "-Wl,-Bdynamic" "-l" "zmq" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util"
= note: /home/osboxes/ursadb/target/release/build/zmq-711f9aefae80083c/build_script_build-711f9aefae80083c.build_script_build0.rcgu.o: In function `build_script_build::main::ha5cc5cd5a08c4033':
build_script_build0-5ea246a54410eb6924d72faee8e217fe.rs:(.text._ZN18build_script_build4main17ha5cc5cd5a08c4033E+0x9a): undefined reference to `zmq_has'
collect2: error: ld returned 1 exit status
I thought that libzmq3-dev should be good for rust-zmq?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 15
actually I tried 4.2.5 and it works fine. But for now i have similar problem on windows.
is there a solution to this problem …
I have the same problem, also on Jessie. I tried with
cargo build --no-default-features
but I get the same error message (build.rs:8: undefined reference to 'zmq_has'
)The offending build script line is inside a function marked with
#[cfg(feature = "zmq_has")]
so I assume thatcfg
is misreporting somehow. I experimentally forced the issue in a local copy by straight-up removing thezmq_has
version ofmain
there, and the project built successfully.