erickt / rust-zmq

Rust zeromq bindings.
Apache License 2.0
886 stars 189 forks source link

Getting "error: failed to run custom build command for `zmq-sys v0.11.0`" #336

Open ealione opened 2 years ago

ealione commented 2 years ago

After installing libzmq as shown on the README and declaring the dependency I am getting the following error when building.

/home/user/.cargo/bin/cargo test --color=always --message-format=json-diagnostic-rendered-ansi --no-run --manifest-path /home/user/IdeaProjects/test/network/Cargo.toml Compiling zmq-sys v0.11.0 error: failed to run custom build command forzmq-sys v0.11.0 Caused by: process didn't exit successfully:/home/user/IdeaProjects/test/target/debug/build/zmq-sys-444664b959f2d2b1/build-script-main(exit status: 101) --- stdout cargo:rerun-if-env-changed=LIBZMQ_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=LIBZMQ_STATIC cargo:rerun-if-env-changed=LIBZMQ_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR --- stderr thread 'main' panicked at 'Unable to locate libzmq: "pkg-config" "--libs" "--cflags" "libzmq" "libzmq >= 4.1"did not exit successfully: exit status: 1 error: could not find system library 'libzmq' required by the 'zmq-sys' crate --- stderr Package libzmq was not found in the pkg-config search path. Perhaps you should add the directory containinglibzmq.pc' to the PKG_CONFIG_PATH environment variable Package 'libzmq', required by 'virtual:world', not found Package 'libzmq', required by 'virtual:world', not found ', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/zmq-sys-0.11.0/build/pkg_config.rs:26:17 stack backtrace: 0: rust_begin_unwind at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5 1: std::panicking::begin_panic_fmt at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:457:5 2: build_script_main::find::configure at ./build/pkg_config.rs:26:17 3: build_script_main::main at ./build/main.rs:6:5 4: core::ops::function::FnOnce::call_once at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:227:5 note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. Process finished with exit code 101`

System

Distributor ID: Linuxmint Description: Linux Mint 20.2 Release: 20.2 Codename: uma

dev-agk commented 1 year ago

Facing the same issue even when the library linkers are specified. @esmeraldaliaj any luck on this?