Create a singleton holding a context or a global variable zmq::context_t (c++ bindings but problem is with zmq_term function). Ship this singleton / global in a DLL. Link to an exe program and it will fail when calling destructor (zmq_term).
However, if the context is self-contained inside some object which is not global, then it is destroyed properly.
Context is initialized only once, application is single-threaded.
I don't know if it is reproducible under linux / other environments. It fails on Windows 7 x64 with ZeroMQ-4.0.1, used gtest.
Windows 7 x64, VS2010. Single-threaded application