[zeromq-dev] linking to a static 0MQ 2.2.0 library in VS10

Jonathan Livni jonathan.livni at gmail.com
Sun Apr 29 07:28:33 CEST 2012


I'm trying to build a 0MQ C++
example<http://zguide.zeromq.org/cpp%3awuserver> using
VS10 and ZeroMQ 2.2.0.

I downloaded the windows
sources<http://download.zeromq.org/zeromq-2.2.0.zip> and
tried to follow these
instructions<http://lists.zeromq.org/pipermail/zeromq-dev/2011-September/013150.html>
in
order to build 0MQ statically. Specifically:

   - Switched to Release
   - For all 7 projects in the solution:
      - set General\Configuration Type to Static library (.lib)
      - set C/C++\Code Generation\Runtime Library to Multi-threaded (/MT)
      - added ZMQ_STATIC to C/C++\Preprocessor\Preprocessor Definitions
   - Updated zmq.h and zmq_utils.h so that if _MSC_VER and ZMQ_STATIC are
   defined thenDLL_EXPORT will also be defined

At this point 0MQ seems to build well.

   - Created an empty console project:
      - switched to Release
      - added a single cpp file with the example linked above
         - changed random to rand, srandom to srand and snprintf to
         _snprintf
      - set C/C++\Code Generation\Runtime Library to Multi-threaded (/MT)
      - added ...\zeromq-2.2.0\include folder to C/C++\General\Additional
      Include Directories
      - added ...\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?

btw, this question is also posted on Stack Overflow
here<http://stackoverflow.com/questions/10367678/linking-to-a-static-0mq-library-in>.


Regards,
  Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120429/917c6f00/attachment.htm>


More information about the zeromq-dev mailing list