Pyrex installation on windows XP: step-by-step guide

Gonzalo Monzón gmc at serveisw3.net
Sun May 21 22:31:41 EDT 2006


Robert Kern escribió:

>Gonzalo Monzón wrote:
>  
>
>>sturlamolden escribió:
>>    
>>
>
>  
>
>>>I don't think this is safe. MinGW links with msvcrt.dll whereas the
>>>main Python distribution links with msvcr71.dll (due to Visual C++
>>>2003).  It is not safe to mix and blend different C runtime libraries.
>>>If you are to build a C extension with MinGW, you also need to build
>>>Python against msvcrt.dll, i.e. you have to use a Python built with
>>>MinGW or Visual C++ 6.0. There other option is to make MinGW link
>>>against msvcr71.dll. I don't know if that is feasible.
>>>      
>>>
>>I use Python 2.4.3 (msvcrt71) and I succesfully installed the last 
>>version of binutils, pyrex and MinGW, some weeks ago, using Julien Fiore 
>>step-by-step guide, so "my" MinGW is linking with msvcrt71.dll, with the 
>>default configuration.
>>
>>I don't understand why do you say MinGW links with msvcrt.dll... perhaps 
>>you've got an older version than the ones Julien posted?
>>    
>>
>
>Nope. He said it because it is true. Use Dependency Walker
>(http://www.dependencywalker.com) to see for yourself what DLLs are linked in.
>In fact, *both* DLLs are linked in. Sometimes this works fine, other times it
>does not.
>
>If you would like a more visceral demonstration, write a small C++ extension
>that uses std::cout.
>
>  
>
I see there are both libraries linked in my pyrex modules...  However, 
when one should expect to have problems with this "dll nightmare", if 
you always provide the right msvcr71.dll bundled within your project -I 
mean, using py2exe by example- ?

Of course if you didn't bundle the right crt, it does depend on the 
available crt on target system... then you would be in trouble if user 
doesn't have msvcrt71, or anyway, could be in trouble linking the 
"right" library?

Thanks for any explanation.

Regards,
Gonzalo





More information about the Python-list mailing list