Closed swetha9198 closed 3 years ago
Given the few info you provided, I would think it's a problem in your setup rather than in the library.
Being a linking problem, I suggest you to try manually specifying the exact libzmq library you are using via an absolute path (e.g. something similar to -l/usr/local/lib/libzmq.so
depending on where you installed it). Moreover, I will also check that this library path for libzmq was also the one used during the build of cppzmq.
I used sudo install libzmq-dev to install the libzmq library, and manually added the cppzmq.h to /usr/include folder
It does not sound as the cleanest way to set it up, but AFAICT it might be enough.
I will check:
libzmq-dev
is the right package to install (e.g. I see that some distributions provide libzmq3-dev
)nm /usr/local/lib/libzmq.so
)
This is my error: /usr/bin/g++ -g -pthread -lzmq /home/swetha/work/GUI-RANEMU/GUI-RANEMU.cpp -o /home/swetha/work/GUI-RANEMU/GUI-RANEMU /tmp/ccefaiXb.o: In function
zmq::error_t::error_t()': /usr/local/include/zmq.hpp:290: undefined reference to
zmq_errno' /tmp/ccefaiXb.o: In functionzmq::error_t::what() const': /usr/local/include/zmq.hpp:294: undefined reference to
zmq_strerror' /tmp/ccefaiXb.o: In functionzmq::message_t::message_t()': /usr/local/include/zmq.hpp:399: undefined reference to
zmq_msg_init' /tmp/ccefaiXb.o: In functionzmq::message_t::~message_t()': /usr/local/include/zmq.hpp:494: undefined reference to
zmq_msg_close' /tmp/ccefaiXb.o: In functionzmq::message_t::data()': /usr/local/include/zmq.hpp:574: undefined reference to
zmq_msg_data' /tmp/ccefaiXb.o: In functionzmq::context_t::context_t()': /usr/local/include/zmq.hpp:784: undefined reference to
zmq_ctx_new' /tmp/ccefaiXb.o: In functionzmq::context_t::close()': /usr/local/include/zmq.hpp:854: undefined reference to
zmq_ctx_term' /tmp/ccefaiXb.o: In functionzmq::detail::socket_base::bind(char const*)': /usr/local/include/zmq.hpp:1801: undefined reference to
zmq_bind' /tmp/ccefaiXb.o: In functionzmq::detail::socket_base::send(zmq::const_buffer, zmq::send_flags)': /usr/local/include/zmq.hpp:1891: undefined reference to
zmq_send' /usr/local/include/zmq.hpp:1894: undefined reference tozmq_errno' /tmp/ccefaiXb.o: In function
zmq::detail::socket_base::send(zmq::message_t&, zmq::send_flags)': /usr/local/include/zmq.hpp:1901: undefined reference tozmq_msg_send' /usr/local/include/zmq.hpp:1904: undefined reference to
zmq_errno' /tmp/ccefaiXb.o: In functionzmq::socket_t::socket_t(zmq::context_t&, int)': /usr/local/include/zmq.hpp:2144: undefined reference to
zmq_socket' /tmp/ccefaiXb.o: In functionzmq::socket_t::close()': /usr/local/include/zmq.hpp:2184: undefined reference to
zmq_close' collect2: error: ld returned 1 exit statusBuild finished with error(s). The terminal process terminated with exit code: -1.
I installed libzmq and cppzmq. I added -lzmq in the tasks.json file of my vscode project but am still getting this error. Can anyone please help?