0

I am getting multiple undefined reference errors from zmq.hpp such as:

`build-client-Desktop_Qt_5_15_2_GCC_64bit-Debug/../client/Headers/zmq.hpp:113: undefined reference to zmq_errno'

and the others are zmq_strerror, zmq_msg_init etc. there are like 20 of them.

I guess the hpp file can not find the zmq.h ?

I added the headers also in .pro file in QT like:

SOURCES += \
        main.cpp

RESOURCES += qml.qrc

HEADERS +=  \
    Headers/zmq.h \
    Headers/zmq.hpp \
    Headers/zmq_utils.h

How am I going to link them?

Screenshot from 2021-11-17 08-41-15

  • OS: Ubuntu 18.04
noobie
  • 361
  • 2
  • 9
  • 1) Please copy/paste the actual ERROR MESSAGE TEXT. Screen shots are discouraged. Your particular screen shot is illegible. 2) This sounds like a LINK error, not a "compile" error. That means that zmq.h is the correct header; the problem is that you're not linking the ZeroMQ *LIBRARY*. – paulsm4 Nov 17 '21 at 06:14
  • Thank you for the comment. QT does not allow me to copy all the error messages. So I copied and pasted 1 of them since the others are the same. I put the screenshot not for the error message but just to show the files in the project, to show where is where. I know it looks strange but since I don't know where is the problem, I just wanted to show what I can – noobie Nov 17 '21 at 06:20
  • Does this answer your question? [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – JaMiT Nov 17 '21 at 06:43

1 Answers1

1

This is a linker error, you forgot to add library to your .pro file. The line looks like this LIBS +=lib_path/lib_name

ygroeg
  • 143
  • 9