[zeromq-dev] Static linking issue on Win32.

Kelly Brock Kerby at inocode.com
Mon Aug 30 14:25:04 CEST 2010


	Just a note about the current setup, you can't get zmq to static
link under Win32 with the current ZMQ_EXPORT setup.  As a suggestion, the
following change is what I'm currently using in my little iocp testbed:

	Found in "include/zmq.h":

/*  Win32 needs special handling for DLL exports
#if defined _WIN32

	Change to:

/*  Win32 needs special handling for DLL exports
#if defined _WIN32 && !defined ZMQ_STATIC_BUILD

	Basically, the problem is if you declare the functions using
__declspec but when you actually define them in the cpp's without
__declspec, the call style is going to be different.  With the
ZMQ_STATIC_BUILD set, it just removes the __declspec like other platforms
which fixes up the calling conventions properly.

	I have fixed this locally for my little iocp testbed simply because
I didn't want to deal with the dll while I'm iterating on things.


More information about the zeromq-dev mailing list