简体   繁体   中英

How to install ZeroMQ on Mac OS X 10.9 for use in a C/C++ program

I'm trying to receive information from an 0MQ Socket in C or C++, but therefore I have to include zmq.h. By downloading the 0MQ software from their website and including this file. Xcode gives the following error:

Undefined symbols for architecture x86_64: "_zmq_init", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

When installing ZeroMQ using brew I get the same error. Is there anyone who know a workaround?

The problem here is that you aren't linking the ZMQ library correctly.

You need to build the library once you've downloaded it (they include all the make scripts you need). Once you have that, you will need to link them to the compiler. I'm not too familiar with XCode, but using gcc it would look something like this:

-L/path/to/zmq/library -lzmq

ZeroMQ is really beautiful though. I've used it on Linux/Windows. Hope you get it working!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM