Compile simple hello world ZeroMQ C example, compile flags?

后端 未结 1 386
春和景丽
春和景丽 2020-12-28 09:37

Trying to compile the example hello_world.c from the zeromq tutorial: http://zguide.zeromq.org/page:all#Ask-and-Ye-Shall-Receive Pretty sure I have everything installed in O

相关标签:
1条回答
  • 2020-12-28 09:53

    You list the ZeroMQ libraries in your question, but you do not actually link with them. Change the command line to this:

    clang -Wall hwserver.c -o hwserver -L/usr/local/lib -lzmq
    

    Explanation of the extra arguments:

    • -L/usr/local/lib tells the linker to add a path (/usr/local/lib) to the library search path.
    • -lzmq tells the library to link with the zmq library.

    The $PATH environment variable have nothing to do with this, it just tells the shell where to look for commands.

    0 讨论(0)
提交回复
热议问题