Compile simple hello world ZeroMQ C example, compile flags?

不打扰是莪最后的温柔 提交于 2019-11-30 02:33:20

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!