[Distutils] why not link modules against msvcrt.dll istead of versioned msvcr*.dll? (mingw32)

Václav Šmilauer eu at doxos.eu
Mon Nov 12 12:37:58 CET 2012


Hi everybody,

I recently (inconclusively) discussed on the mingw-w64 mailing list why 
are compiled modules linked to msvcrt90 (depending on python build) 
rather than to msvcrt. A compiled module was crashing (the DLL would not 
load with "invalid access to memory and such") with msvcr90, while it 
works just fine with msvcrt.

My understanding (based on 
http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx, 
http://msdn.microsoft.com/en-us/library/ms235460.aspx and my 
aforementioned experience)  is that loading two MSVC runtimes at the 
same time is asking for trouble. Dependency Walker shows me that 
python27.dll itself is linking against msvcrt.dll, but 
distutils.cygwincompiler will link against msvcrt90 nevertheless. This 
means both end up loaded.

OTOH I suppose there is a good reason why msvc version detection exists, 
but I am just ignorant of it and would like to ask here.

Cheers, Vaclav
<http://msdn.microsoft.com/en-us/library/ms235460.aspx>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20121112/1ef8c5ea/attachment.html>


More information about the Distutils-SIG mailing list