Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZMQ Compilation problems for C++ examples

Tags:

zeromq

I am trying to compile the ZMQ C++ source code examples provided at zmq.org (i.e. github.com/imatix/zguide.git). My OS is xubuntu and I installed ZMQ prerequisites which are libtool, autoconf, automake and uuid-dev package properly. I installed czmq as well. Compilation and linking of ZMQ itself was fine and libs are located properly under /usr/local/bin. Nevertheless, I am getting below compilation errors. Googling did not help much and I wonder if anyone knows a quick solution to these errors, which originates from the missing header file zmq.hpp. Thanks in advance.

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

......

like image 723
F. Aydemir Avatar asked Jan 09 '13 11:01

F. Aydemir


2 Answers

It looks zmq.hpp has been moved to another git repository beginning with ZMQ 3.2 which is available at https://github.com/zeromq/cppzmq. I have clonned this to same place where a previously extracted the ZMQ's tar ball. Then I created a symbolic link to zmq.hpp from the examples's C++ directory. Then examples compiled fine.

like image 108
F. Aydemir Avatar answered Sep 25 '22 10:09

F. Aydemir


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++>
like image 22
Prem Avatar answered Sep 23 '22 10:09

Prem