[zeromq-dev] Problems with errno on Win32

Martin Sustrik sustrik at 250bpm.com
Sun Feb 21 17:19:27 CET 2010

Hi Brian,

>> I've istalled python 2.6.4.
> OK, this is one thing I need to try.  I have running with Python 2.5
> right now.  I will try 2.6.  But, there are other odd things...
>>> 2. After building 0MQ, copy libzmq.dll and zmq.h into pyzmq\zmq
>>> 3. Build pyzmq:
>>> cd pyzmq
>>> python setup.py build_ext --inplace --library-dirs=.
>> At this point it turned out that I have to copy libzmq.lib to the current
>> directory and rename it to zmq.lib...
> Hmmm, I did not have to do this step.  What errors did you see? 

I don't recall precisly, but it was either 'zmq.lib' missing or simply 
unresolved externals reported by MSVC...

> This
> is odd.  With that said, my Python
> is compiled with Mingw, which may be part of the problem.

So how are you building everything? All python, pyzmq and libzmq using 

Mixing different compilation methods may result in different errno 
symbols seen by different components.

Which makes me wonder whether reporting errors via errno is the right 
thing. The rest of the API/ABI is CRT-agnostic. The errno ties libzmq to 
a specific CRT implementation which can turn out to be pretty nasty in 
some cases.

Still, errno is what people are accutomed to use...

>>> 4. Copy this test script into the pyzmq directory and run
>> Before even testing the script I've used depends.exe to check which C
>> runtime libraries are used with individual components of the test.
>> It looked perfectly right: all pyhon.exe _zmq.so and libzmq.dll used the
>> same library - msvcr90.dll
> Even more odd.  After I compile the Python extension, I don't even get _zmq.so,
> Instead I get _zmq.pyd, which I guess is a .dll with a few differences:

Oops. A typo. I've meant _zmq.pyd of course.

> http://effbot.org/pyfaq/is-a-pyd-file-the-same-as-a-dll.htm
> Not sure why you get a .so though.
> Final odd point:  I checked _zmq.pyd and libzmq.dll and depends.exe
> complained that it couldn't find
> 3 DLLs:
> I am going to try with Python 2.6 and do some further investigating
> these things.  Seem like these things
> could definitely be related.

Yes, please, let me know what's the outcome.


More information about the zeromq-dev mailing list