我正在尝试编译zmq.org(即github.com/imatix/zguide.git)提供的ZMQ C++源代码示例。我的操作系统是xubuntu,我正确安装了ZMQ必备软件libtool,autoconf,automake和uuid-dev软件包。我也安装了czmq。 ZMQ本身的编译和链接很好,并且库位于/usr/local/bin下。但是,我遇到了编译错误。谷歌搜索没有太大帮助,我想知道是否有人知道这些错误的快速解决方案,这是由于缺少头文件zmq.hpp而引起的。提前致谢。

   $./build all
   hwclient.cpp
   hwclient.cpp:6:19: fatal error: zmq.hpp: No such file or directory
   compilation terminated.
   hwserver.cpp
   hwserver.cpp:6:19: fatal error: zmq.hpp: No such file or directory
   compilation terminated.
   identity.cpp
   identity.cpp:7:19: fatal error: zmq.hpp: No such file or directory
   compilation terminated.
   lbbroker.cpp
   In file included from lbbroker.cpp:7:0:
   zhelpers.hpp:29:19: fatal error: zmq.hpp: No such file or directory
   compilation terminated.
   lpclient.cpp
   In file included from lpclient.cpp:6:0:
   zhelpers.hpp:29:19: fatal error: zmq.hpp: No such file or directory
   compilation terminated.
   lpserver.cpp
   In file included from lpserver.cpp:8:0:
   zhelpers.hpp:29:19: fatal error: zmq.hpp: No such file or directory
   compilation terminated.
   mdbroker.cpp
   In file included from zmsg.hpp:35:0,
             from mdbroker.cpp:7:
   zhelpers.hpp:29:19: fatal error: zmq.hpp: No such file or directory
   compilation terminated.
   mdclient.cpp

......

最佳答案

看起来zmq.hpp已从ZMQ 3.2开始移动到另一个git存储库,该存储库可从https://github.com/zeromq/cppzmq获得。我已经将它克隆到以前提取ZMQ的tar球的位置。然后,我从示例的C++目录中创建了指向zmq.hpp的符号链接(symbolic link)。然后实例编译良好。

关于zeromq - C++示例的ZMQ编译问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14233887/

10-13 09:39