简体   繁体   English

g ++未定义的ZMQ引用

[英]g++ undefined reference to ZMQ

I developed my project on my workplace pc (where all is going well), but when I try to compile on my home pc (both ubuntu 12.04) I get the following message: 我在我的工作场所PC上开发了我的项目(一切顺利)但是当我尝试在我的家用电脑上编译时(ubuntu 12.04)我得到以下消息:

undefined reference to `zmq_sendmsg'

I can't understand what am I missing, since I see this 我无法理解我错过了什么,因为我看到了这一点

/usr/local/lib/libzmq.so
/usr/local/lib/libzmq.so.3
/usr/local/lib/libzmq.so.3.0.0

so my ZeroMQ installation seems to be ok. 所以我的ZeroMQ安装似乎没问题。 Can someone suggest what could I check? 有人可以建议我可以检查什么?

When you link you have to add -lzmq so the linker will pull in functions from libzmq. 当您链接时,您必须添加-lzmq,以便链接器将从libzmq中提取函数。

Here's how I compile a hello world program: 这是我编译hello world程序的方法:

gcc -o hello hello.c -lzmq

We need the linker command you use to be able to tell. 我们需要您使用的链接器命令来告诉我们。

Can you build some of the ZeroMQ example programs? 你能构建一些ZeroMQ示例程序吗? Can you build things with the v2 versions in Ubuntu, eg 你可以用Ubuntu中的v2版本构建东西,例如

edd@max:~$ COLUMNS=40 dpkg -l|grep libzmq
ii  libzmq-dev     2.1.11-1ubuntu ZeroMQ lightweight messaging kernel (develop
ii  libzmq1        2.1.11-1ubuntu ZeroMQ lightweight messaging kernel (shared 
edd@max:~$ 

ZeroMQ is a pretty standard library as far as build tools go, so you must be missing something simple we should find. 就构建工具而言,ZeroMQ是一个非常标准的库,所以你必须缺少我们应该找到的简单的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM