ZeroMq Golang绑定无法在Windows上构建

时间:2015-04-23 13:03:22

标签: go zeromq

我试图让Go ZMQ4绑定在Windows上运行。 不幸的是,我无法构建zmq库和Gozmq软件,并且出现以下错误:

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

*因为平台不支持它们或 使用-no-undefined显式请求它, libtool只会创建它的静态版本。 make [2]:离开目录/e/Users/mmarques/Desktop/zeromq-4.0.5/src' make[1]: Leaving directory / e / Users / mmarques / Desktop / zeromq-4.0.5 / src' 全力以赴 make [1]:输入目录/e/Users/mmarques/Desktop/zeromq-4.0.5/doc' make[1]: Nothing to be done for all'。 make [1]:离开目录/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:在函数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到__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到__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到__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到__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到__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到__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到__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到__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 对__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]错误1

我所做的是下载Zmq Sources并执行

  

配置

     

任何人都可以帮我弄清楚如何解决这个问题,并在Windows环境中设置Zmq Go Binding?

1 个答案:

答案 0 :(得分:1)

确保安装了MinGW gcc工具链。 Go需要它能够从zmq4正在执行的Go代码调用C代码。如果你看看zmq4 repo,你可以看到.h头文件。请参阅:https://golang.org/doc/installhttps://golang.org/cmd/cgo/