[英]Linking zeromq static library on solaris
I want to link the zeromq libraries in my build so they do not have to be installed separately on the end users machine. 我想在我的构建中链接zeromq库,因此不必在最终用户计算机上单独安装它们。
I configured zeromq using: 我使用以下命令配置了zeromq:
./configure --enable-static --disable-shared --prefix=/home/xx/out
but when I do: 但是当我这样做时:
g++ -o zclient zmqclient.o /home/xx/out/lib/libzmq.a
I get linking errors: 我得到链接错误:
Undefined first referenced
symbol in file
recv /opt/zmq/out/lib/libzmq.a(libzmq_la-signaler.o)
send /opt/zmq/out/lib/libzmq.a(libzmq_la-signaler.o)
__xnet_connect /opt/zmq/out/lib/libzmq.a(libzmq_la-tcp_connecter.o)
__xnet_socket /opt/zmq/out/lib/libzmq.a(libzmq_la-ip.o)
__xnet_getsockopt /opt/zmq/out/lib/libzmq.a(libzmq_la-tcp_connecter.o)
accept /opt/zmq/out/lib/libzmq.a(libzmq_la-tcp_listener.o)
listen /opt/zmq/out/lib/libzmq.a(libzmq_la-tcp_listener.o)
uuid_generate /opt/zmq/out/lib/libzmq.a(libzmq_la-uuid.o)
setsockopt /opt/zmq/out/lib/libzmq.a(libzmq_la-tcp_listener.o)
getaddrinfo /opt/zmq/out/lib/libzmq.a(libzmq_la-ip.o)
freeaddrinfo /opt/zmq/out/lib/libzmq.a(libzmq_la-ip.o)
__xnet_socketpair /opt/zmq/out/lib/libzmq.a(libzmq_la-signaler.o)
__xnet_bind /opt/zmq/out/lib/libzmq.a(libzmq_la-tcp_listener.o)
uuid_unparse /opt/zmq/out/lib/libzmq.a(libzmq_la-uuid.o)
ld: fatal: symbol referencing errors. No output written to zclient
collect2: ld returned 1 exit status
Can anyone tell me where I am going wrong, or provide me with an alternative method? 谁能告诉我哪里出错了,还是给我一个替代方法?
Thanks! 谢谢!
Turns out the libraries: 结果库:
-lsocket -lnsl -luuid
are standard on linux but not on solaris and need to be included in the Makefile like so: 是linux上的标准,但不是solaris,需要像下面这样包含在Makefile中:
g++ -lsocket -lnsl -luuid zmqclient.cpp /home/xx/out/lib/libzmq.a -o zmqclient
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.