This may be a Visual Studio question more than anything else...
I'm trying to build a 0MQ C++ example using VS10 and ZeroMQ 2.2.0.
I downloaded the windows sources and tried to follow these instructions in order to build 0MQ statically. Specifically:
General\Configuration Type
to Static library (.lib)
C/C++\Code Generation\Runtime Library
to Multi-threaded (/MT)
ZMQ_STATIC
to C/C++\Preprocessor\Preprocessor Definitions
zmq.h
and zmq_utils.h
so that if _MSC_VER
and ZMQ_STATIC
are defined then DLL_EXPORT
will also be definedAt this point 0MQ seems to build well.
random
to rand
, srandom
to srand
and snprintf
to _snprintf
C/C++\Code Generation\Runtime Library
to Multi-threaded (/MT)
...\zeromq-2.2.0\include
folder to C/C++\General\Additional Include Directories
...\zeromq-2.2.0\builds\msvc\Release\*.lib
to Linker\Input\Additional Dependencies
However I still receive the following linking errors:
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_bind
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_close
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_errno
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_init
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_msg_data
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_strerror
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_socket
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_msg_init_size
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_term
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_msg_close
1>zmqexp.obj : error LNK2001: unresolved external symbol __imp__zmq_send
What have I missed?
I had similar errors - not when trying to statically link, but just trying to create a ZMQ project and link the .lib 'stubs' for the dll.
In my case it was because I was trying to link the 64-bit libraries into a 32-bit project. I had downloaded the wrong version. When I got the right ones, ie x86 instead of x64, it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With