2013-01-09 71 views
8

我想編譯zmq.org提供的ZMQ C++源代碼示例(即github.com/imatix/zguide.git)。我的操作系統是xubuntu,並且我正確安裝了libtool,autoconf,automake和uuid-dev軟件包等ZMQ先決條件。我也安裝了czmq。編譯和鏈接ZMQ本身很好,libs正確地位於/ usr/local/bin下。不過,我收到了編譯錯誤。谷歌搜索沒有什麼幫助,我不知道是否有人知道這些錯誤的快速解決方案,這些錯誤源自缺少的頭文件zmq.hpp。提前致謝。ZMQ C++示例的編譯問題

$./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 

......

回答

10

它看起來zmq.hpp已經移動到與ZMQ 3.2是可以在https://github.com/zeromq/cppzmq開始另外的Git倉庫。我已經將此克隆到了先前提取ZMQ的焦油球的地方。然後我從例子的C++目錄創建了一個到zmq.hpp的符號鏈接。然後編譯好的例子。

-1
[email protected]~/Code/zeromq>ls 
cppzmq-master.zip zguide zmqpp-develop zmqpp-develop.zip 
[email protected]~/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 
[email protected]~/Code/zeromq>ls 
cppzmq-master cppzmq-master.zip zguide zmqpp-develop zmqpp-develop.zip 
[email protected]~/Code/zeromq>cd cppzmq-master/ 
[email protected]~/Code/zeromq/cppzmq-master>ls 
[email protected]~/Code/zeromq/cppzmq-master>sudo cp zmq.hpp /usr/include/ 
[email protected]~/Code/zeromq/cppzmq-master>cd ~/Code/zeromq/zguide/examples/C++ 
[email protected]~/Code/zeromq/zguide/examples/C++>./build all 
Building C++ examples... 
hwclient.cpp 
hwserver.cpp 
identity.cpp 
interrupt.cpp 
... 
[email protected]~/Code/zeromq/zguide/examples/C++>