[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zeromq-dev
Subject:    Re: [zeromq-dev] Using ZMQ with Rust
From:       Narendra Joshi <narendraj9 () gmail ! com>
Date:       2021-05-17 19:29:46
Message-ID: 87v97hi2fp.fsf () gmail ! com
[Download RAW message or body]

Osiris Pedroso <opedroso@gmail.com> writes:

> Hello ZMQers,
>
> I am starting a new job where we use Rust as the main language.
> I am preparing myself by learning Rust the language and I would like to
> write some ZMQ sample code using it.
>
> I checked the website and there are lots of examples but there is not a
> starting guide.
> The only hint is to add the string "zmq = "0.9" under "[Dependencies]" in
> the projects Cargo.toml file to get access to ZMQ libraries.
>
> I installed Rust on a Windows machine.
> After successfully executing "cargo new rust-zmq-hello-world" which creates
> a a project of this name which compiles and runs fine like this:
>
>   PS C:\Users\opedroso\rust-zmq-hello-world> cargo check
>     Checking rust-zmq-hello-world v0.1.0
> (C:\Users\opedroso\rust-zmq-hello-world)
>     Finished dev [unoptimized + debuginfo] target(s) in 1.57s
>
> I then added the string above to my Cargo.toml project file. No other
> changes.
> After that when I execute "cargo check" or "cargo run" on this project
> directory, I get this error:
>
> PS C:\Users\opedroso\rust-zmq-hello-world> cargo check
>     Blocking waiting for file lock on package cache
>     Updating crates.io index
>     Blocking waiting for file lock on package cache
>     Blocking waiting for file lock on package cache
>    Compiling pkg-config v0.3.19
>    Compiling error-chain v0.10.0
>    Compiling toml v0.2.1
>    Compiling libc v0.2.94
>    Compiling bitflags v1.2.1
>    Compiling log v0.4.14
>    Compiling zmq v0.9.2
>     Checking cfg-if v1.0.0
>    Compiling metadeps v1.1.2
>    Compiling zmq-sys v0.11.0
> error: failed to run custom build command for `zmq-sys v0.11.0`
>
> Caused by:
>   process didn't exit successfully:
> `C:\Users\opedroso\rust-zmq-hello-world\target\debug\build\zmq-sys-7f0b989f3761c178\build-script-main`
> (exit code: 101)
>   --- stdout
>   cargo:rerun-if-env-changed=LIBZMQ_NO_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-pc-windows-msvc
>   cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
>   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-pc-windows-msvc
>   cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
>   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-pc-windows-msvc
>   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
>   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:

Do you have libzmq installed on our machine? I am not sure how it works
on Windows. On Linux, it would be available as a package that you can
install using your package manager. 

>   Failed to run `"pkg-config" "--libs" "--cflags" "libzmq" "libzmq >=
> 4.1"`: The system cannot find the file specified. (os error 2)',
> C:\Users\opedroso\.cargo\registry\src\github.com-1ecc6299db9ec823\zmq-sys-0.11.0\build\pkg_config.rs:26
> :17
>   note: run with `RUST_BACKTRACE=1` environment variable to display a
> backtrace
>
> Appreciate any pointers on passing this hurdle.
>
> Best regards,
> Osiris Pedroso
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>

Best,
-- 
Narendra Joshi
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic