Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Open 'builds\msvc\msvc10.sln' in VC++ 2010
- 2. Change both zmq.h and zmq_utils.h like this:
- /* Handle DSO symbol visibility */
- #if defined _WIN32
- # if defined DLL_EXPORT
- # define ZMQ_EXPORT __declspec(dllexport)
- # else
- # define ZMQ_EXPORT __declspec(dllimport)
- # endif
- #else
- # if defined __SUNPRO_C || defined __SUNPRO_CC
- # define ZMQ_EXPORT __global
- # elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER
- # define ZMQ_EXPORT __attribute__ ((visibility("default")))
- # else
- # define ZMQ_EXPORT
- # endif
- #endif
- // TO
- /* Handle DSO symbol visibility */
- #if defined _WIN32
- # if defined ZMQ_STATIC
- # define DLL_EXPORT
- # endif
- # if defined DLL_EXPORT
- # define ZMQ_EXPORT __declspec(dllexport)
- # else
- # define ZMQ_EXPORT __declspec(dllimport)
- # endif
- #else
- # if defined __SUNPRO_C || defined __SUNPRO_CC
- # define ZMQ_EXPORT __global
- # elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER
- # define ZMQ_EXPORT __attribute__ ((visibility("default")))
- # else
- # define ZMQ_EXPORT
- # endif
- #endif
- 3. Use below settings for 'libzmq' project in both Debug and Release build modes:
- Debug:
- Configuration Properties > General > Target Name > $(ProjectName)_d
- Configuration Properties > General > Configuration Type > Static library (.lib)
- Configuration Properties > General > Character Set > Use Unicode Character Set
- Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions > ZMQ_STATIC
- Configuration Properties > C/C++ > Code Generation > Runtime Library > Multi-threaded Debug (/MTd)
- Configuration Properties > C/C++ > Code Generation > Struct Member Alignment > 4 Byte (/Zp4)
- Configuration Properties > C/C++ > Output Files > Program Database File Name > $(OutDir)$(ProjectName)_d.pdb
- Release:
- Configuration Properties > General > Configuration Type > Static library (.lib)
- Configuration Properties > General > Character Set > Use Unicode Character Set
- Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions > ZMQ_STATIC
- Configuration Properties > C/C++ > Code Generation > Runtime Library > Multi-threaded (/MT)
- Configuration Properties > C/C++ > Code Generation > Struct Member Alignment > 4 Byte (/Zp4)
- Configuration Properties > C/C++ > Output Files > Program Database File Name > $(OutDir)$(ProjectName).pdb
- 4. Bulid 'libzmq' project then grab these files and copy them to our lib folder:
- Debug: bin\Win32\libzmq_d.lib bin\Win32\libzmq_d.pdb
- Release: bin\Win32\libzmq.lib bin\Win32\libzmq.pdb
- 5. Don't forget to define ZMQ_STATIC in your own projects and add ws2_32.lib to your linker dependecies:
- Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions > ZMQ_STATIC
- Configuration Properties > Linker > Input > Additional Dependencies > ws2_32.lib
- // ALSO
- Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions > WIN32_LEAN_AND_MEAN
- // OR
- Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions > _WINSOCKAPI_
- 6. For more info:
- http://lists.zeromq.org/pipermail/zeromq-dev/2010-November/007756.html
- http://lists.zeromq.org/pipermail/zeromq-dev/2011-September/013150.html
- http://lists.zeromq.org/pipermail/zeromq-dev/2010-September/005870.html
- http://lists.zeromq.org/pipermail/zeromq-dev/2012-June/017529.html
- http://grokbase.com/t/zeromq/zeromq-dev/124xdvs0en/linking-to-a-static-0mq-2-2-0-library-in-vs10
- https://zeromq.jira.com/browse/LIBZMQ-201
Advertisement
Add Comment
Please, Sign In to add comment