ZeroMQ的Golang绑定在Windows上无法构建。

huangapple go评论91阅读模式
英文:

ZeroMq Golang binding cannot build on Windows

问题

我正在尝试在Windows上使Go ZMQ4绑定工作。不幸的是,我无法构建zmq库和Gozmq软件,并且出现以下错误:

*** 由于此库不能包含未定义的符号,
*** 因为平台不支持它们或
*** 它是通过-no-undefined显式请求的,
*** libtool只会创建其静态版本。
make[2]: 离开目录“/e/Users/mmarques/Desktop/zeromq-4.0.5/src'
make[1]: 离开目录“/e/Users/mmarques/Desktop/zeromq-4.0.5/src'
在文档中进行全部制作
make[1]: 进入目录“/e/Users/mmarques/Desktop/zeromq-4.0.5/doc'
make[1]: 无需执行任何操作。
make[1]: 离开目录“/e/Users/mmarques/Desktop/zeromq-4.0.5/doc'
在perf中进行全部制作
make[1]: 进入目录“/e/Users/mmarques/Desktop/zeromq-4.0.5/perf'
CXX local_lat.o
CXXLD local_lat.exe
local_lat.o: 在函数“main”中:
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:45: 对“__imp_zmq_init”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:51: 对“__imp_zmq_socket”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:57: 对“__imp_zmq_bind”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:63: 对“__imp_zmq_msg_init”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:69: 对“__imp_zmq_recvmsg”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:75: 对“__imp_zmq_msg_size”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:79: 对“__imp_zmq_sendmsg”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:72: 对“__imp_zmq_strerror”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:86: 对“__imp_zmq_msg_close”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:92: 对“__imp_zmq_sleep”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:94: 对“__imp_zmq_close”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:100: 对“__imp_zmq_term”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:102: 对“__imp_zmq_strerror”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:81: 对“__imp_zmq_strerror”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:59: 对“__imp_zmq_strerror”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:65: 对“__imp_zmq_strerror”的未定义引用
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:96: 对“__imp_zmq_strerror”的未定义引用
local_lat.o:e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:88: 跟随更多未定义引用“__imp_zmq_strerror”
collect2.exe: 错误: ld 返回了 1 退出状态
make[1]: *** [local_lat.exe] 错误 1
make[1]: 离开目录“/e/Users/mmarques/Desktop/zeromq-4.0.5/perf'
make: *** [all-recursive] 错误 1

我所做的是下载Zmq源代码并执行以下操作:

sh configure

make

有人可以帮助我解决这个问题,并在Windows环境中设置Zmq Go绑定吗?

英文:

I'm trying to get Go ZMQ4 binding to work on windows.
Unfortunately, i'm not able to build the zmq library neither Gozmq software and get the following errors:

*** Since this library must not contain undefined symbols,

*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
make[2]: Leaving directory /e/Users/mmarques/Desktop/zeromq-4.0.5/src'
make[1]: Leaving directory
/e/Users/mmarques/Desktop/zeromq-4.0.5/src'
Making all in doc
make[1]: Entering directory /e/Users/mmarques/Desktop/zeromq-4.0.5/doc'
make[1]: Nothing to be done for
all'.
make[1]: Leaving directory /e/Users/mmarques/Desktop/zeromq-4.0.5/doc'
Making all in perf
make[1]: Entering directory
/e/Users/mmarques/Desktop/zeromq-4.0.5/perf'
CXX local_lat.o
CXXLD local_lat.exe
local_lat.o: In function main':
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:45: undefined referenc
e to
__imp_zmq_init'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:51: undefined referenc
e to __imp_zmq_socket'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:57: undefined referenc
e to
__imp_zmq_bind'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:63: undefined referenc
e to __imp_zmq_msg_init'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:69: undefined referenc
e to
__imp_zmq_recvmsg'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:75: undefined referenc
e to __imp_zmq_msg_size'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:79: undefined referenc
e to
__imp_zmq_sendmsg'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:72: undefined referenc
e to __imp_zmq_strerror'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:86: undefined referenc
e to
__imp_zmq_msg_close'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:92: undefined referenc
e to __imp_zmq_sleep'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:94: undefined referenc
e to
__imp_zmq_close'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:100: undefined referen
ce to __imp_zmq_term'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:102: undefined referen
ce to
__imp_zmq_strerror'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:81: undefined referenc
e to __imp_zmq_strerror'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:59: undefined referenc
e to
__imp_zmq_strerror'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:65: undefined referenc
e to __imp_zmq_strerror'
e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:96: undefined referenc
e to
__imp_zmq_strerror'
local_lat.o:e:\Users\mmarques\Desktop\zeromq-4.0.5\perf/local_lat.cpp:88: more u
ndefined references to __imp_zmq_strerror' follow
collect2.exe: error: ld returned 1 exit status
make[1]: *** [local_lat.exe] Error 1
make[1]: Leaving directory
/e/Users/mmarques/Desktop/zeromq-4.0.5/perf'
make: *** [all-recursive] Error 1

What I've done was download Zmq Sources and perform a

> sh configure

> make

Can anyone help me figure out how to solve this, and setup up a Zmq Go Binding on Windows environment?

答案1

得分: 1

确保您已安装MinGW gcc工具链。Go需要它才能从Go代码中调用C代码,而zmq4正在这样做。如果您查看zmq4存储库,您可以看到.h头文件。请参阅:https://golang.org/doc/install和https://golang.org/cmd/cgo/。

英文:

Make sure that you have the MinGW gcc toolchain installed. Go needs it to be able to call C code from Go code which zmq4 is doing. If you check out the zmq4 repo you can see the .h header file. See: https://golang.org/doc/install and https://golang.org/cmd/cgo/.

huangapple
  • 本文由 发表于 2015年4月23日 21:03:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/29824285.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定