[python-win32] Building extensions with non-MSVC compilers

Mauro Cicognini mcicogni at libero.it
Sun Oct 31 17:18:42 CET 2004


Hi everybody,
I've tried to Google for all past references to the subject, but I could 
not find any conclusive answer to my real question, which is "Will a 
mingw-built extension work with a standard MSVC-built Python interpreter?"

I'm asking because I am one of the (two) people trying to maintain the 
Win32 build of Python-LDAP. As you might know, it is actually just a 
thin wrapper (coming mostly from SWIG) around a stock LDAP library 
distro, which currently is OpenLDAP (used to be UMich at some time in 
the past).

Those libraries used to support MSVC for win32 builds; however, this 
support is unfortunately all but defunct. After a prolenged hiatus, 
during which win32 support deteriorated, it was resurrected, but using 
mingw instead. This is likely due to lack of manpower on the core 
developers' part, and I do not blame them, as mingw is much easier to 
maintain in an almost entirely UNIX-oriented project.

At this point, AFAICT I'm left with three options:

   1. maintain MSVC support within OpenLDAP (although just for the core
      libraries)
   2. build Python-LDAP with mingw, and see what happens
   3. abandon the win32 port of Python-LDAP, and start work on new
      software providing a similar API using ADSI through the pythonCOM
      extension.

Being hard pressed for time, what I'd like to do is obviously option 2, 
which also appears to me to be the best idea going forward.
Option 1, in fact, isn't very elegant, and may require some nontrivial 
analysis of the underlying C code for obscure incompatibilities which by 
no means I intend to do.
Option 3 is conceptually tempting, could pose less risk of obsolescence 
moving forward (and maybe even possible with less effort than I expect), 
but I completely lack the resources to work on it, and I'd also wonder 
how much MS's implementation covers of the original LDAP API draft.

So this brings me back to the original question: what happens when one 
uses an interpreter and an extension built with different compilers?

Thanks in advance for any suggestions,

Mauro




More information about the Python-win32 mailing list