我正在尝试编译zmq.org上提供的ZMQ C ++源代码示例(即github.com/imatix/zguide.git)。我的操作系统是xubuntu,我安装了ZMQ先决条件,正确的是libtool,autoconf,automake和uuid-dev包。我也安装了czmq。 ZMQ本身的编译和链接很好,并且libs正确地位于/ 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
...
答案 0 :(得分:10)
它看起来zmq.hpp已被移动到另一个git存储库,从ZMQ 3.2开始,可在https://github.com/zeromq/cppzmq获得。我把它克隆到以前提取过ZMQ的焦油球的同一个地方。然后我从examples的C ++目录创建了一个到zmq.hpp的符号链接。然后编写的例子很好。
答案 1 :(得分:1)
prem@~/Code/zeromq>ls
cppzmq-master.zip zguide zmqpp-develop zmqpp-develop.zip
prem@~/Code/zeromq>unzip cppzmq-master.zip
Archive: cppzmq-master.zip
235803740753312576495301ebf5b8ed76407173
creating: cppzmq-master/
inflating: cppzmq-master/LICENSE
inflating: cppzmq-master/README
inflating: cppzmq-master/zmq.hpp
prem@~/Code/zeromq>ls
cppzmq-master cppzmq-master.zip zguide zmqpp-develop zmqpp-develop.zip
prem@~/Code/zeromq>cd cppzmq-master/
prem@~/Code/zeromq/cppzmq-master>ls
prem@~/Code/zeromq/cppzmq-master>sudo cp zmq.hpp /usr/include/
prem@~/Code/zeromq/cppzmq-master>cd ~/Code/zeromq/zguide/examples/C++
prem@~/Code/zeromq/zguide/examples/C++>./build all
Building C++ examples...
hwclient.cpp
hwserver.cpp
identity.cpp
interrupt.cpp
...
prem@~/Code/zeromq/zguide/examples/C++>