[zeromq-dev] Example for building against ZMQ with CMake + UDP Multicast Support
Stephan Opfer
opfer at vs.uni-kassel.de
Tue Jan 10 21:47:11 CET 2017
On 10.01.2017 17:28, Luca Boccassi wrote:
> As always on *NIX, use pkg-config and your life will be much easier.
>
> eg:
>
> g++ `pkg-config --cflags --libs libzmq` foo.cpp -o foo
Ok, with pkg-config I can compile, but the linker is still complaining.
Here is my command for compiling:
g++ -DZMQ_BUILD_DRAFT_API=1 -I/usr/local/include -L/usr/local/lib -lzmq
Discovery.cpp -o foo
"pkg-config --cflags --libs libzmq" created "-DZMQ_BUILD_DRAFT_API=1
-I/usr/local/include -L/usr/local/lib -lzmq", which seems right as far
as I can tell.
Here some linker errors:
/tmp/ccLV8vrk.o: In function `main':
Discovery.cpp:(.text+0x24e): undefined reference to `zmq_ctx_new'
Discovery.cpp:(.text+0x28c): undefined reference to `zmq_socket'
Discovery.cpp:(.text+0x2a7): undefined reference to `zmq_socket'
Discovery.cpp:(.text+0x2c2): undefined reference to `zmq_bind'
Discovery.cpp:(.text+0x2fe): undefined reference to `zmq_leave'
Discovery.cpp:(.text+0x369): undefined reference to `zmq_join'
Discovery.cpp:(.text+0x3a5): undefined reference to `zmq_join'
Discovery.cpp:(.text+0x3e1): undefined reference to `zmq_join'
Discovery.cpp:(.text+0x41d): undefined reference to `zmq_connect'
Discovery.cpp:(.text+0x528): undefined reference to `zmq_join'
Discovery.cpp:(.text+0x55a): undefined reference to `zmq_sleep'
Discovery.cpp:(.text+0x5f8): undefined reference to `zmq_leave'
Discovery.cpp:(.text+0x62a): undefined reference to `zmq_sleep'
Discovery.cpp:(.text+0x70c): undefined reference to `zmq_poll'
Discovery.cpp:(.text+0x7ab): undefined reference to `zmq_close'
Discovery.cpp:(.text+0x7e2): undefined reference to `zmq_close'
Discovery.cpp:(.text+0x819): undefined reference to `zmq_ctx_term'
collect2: error: ld returned 1 exit status
--
Distributed Systems Research Group
Stephan Opfer T. +49 561 804-6283 F. +49 561 804-6277
Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel
WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/
More information about the zeromq-dev
mailing list