如何在Windows上链接libzmq?

时间:2017-02-11 13:51:36

标签: windows linker rust rust-cargo

我想将libzmq链接到我的Rust程序。我在"{Binding Value, Converter={staticResource intDecConverter}}"

中有这个
~\.cargo\config

运行[target.x86_64-pc-windows-gnu.chainsaw] rustc-link-search = ["C:\\Program Files\\ZeroMQ 4.0.4\\bin"] 会导致此错误:

cargo test

如您所见, Compiling chainsaw v0.0.1 (file:///D:/chainsaw) error: linking with `gcc` failed: exit code: 1 | = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\\Rust \\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "D:\\chainsaw\\target\\debug\\deps\\chainsaw-0154e16e13da8295.0.o" "-o" "D:\\chainsaw\\target\\debug\\deps\\chainsaw-0154e16e13da8295.exe" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\\ chainsaw\\target\\debug\\deps" "-L" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-l" "zmq" "D:\\chainsaw\\target\\debug\\deps\\liblibc-29ef97a68464c2b7.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows -gnu\\lib\\libtest-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libterm-f5a209a9.rlib" "C:\\Rust\ \lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libgetopts-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib \\libstd-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-f5a209a9.rlib" "C:\\Rust\\l ib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\l ibrand-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcollections-f5a209a9.rlib" "C:\\Rust\\lib\ \rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_unicode-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\li b\\liblibc-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-f5a209a9.rlib" "C:\\Rust\\lib\\r ustlib\\x86_64-pc-windows-gnu\\lib\\liballoc_system-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\ libcore-f5a209a9.rlib" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-f5a209a9.rlib" "-l" "ke rnel32" "-l" "ws2_32" "-l" "userenv" "-l" "shell32" "-l" "advapi32" "-l" "gcc_eh" "-lmingwex" "-lmingw32" "-lgcc" "-lmsv crt" "-luser32" "-lkernel32" "C:\\Rust\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o" = note: ld: cannot find -lzmq 未传递给链接器。

为什么在Cargo配置文件中设置-L "C:\Program Files\ZeroMQ 4.0.4\bin"不起作用?

我已经检查了这些事情:

  • 货物实际上读取配置文件
  • 目录存在
  • rustc-link-search是我的目标三重
  • "链锯"是我的目标的名称
  • 执行干净构建时发生同样的错误

0 个答案:

没有答案