Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

Alf P. Steinbach /Usenet alf.p.steinbach+usenet at gmail.com
Wed Jul 7 17:40:54 EDT 2010


* Alf P. Steinbach /Usenet, on 07.07.2010 23:19:
>
> However developing an extension with MSVC 10 the extension will use the
> 10.0 CRT, which is not necessarily present on the end user's system.
>
> As I see it there are five solutions with different trade-offs:
>
> A Already having Visual Studio 2008 (MSVC 9.0), or coughing up the
> money for an MSDN subscription, or visiting trade shows, so as to
> obtain that compiler version.
> -> Not an option for everybody.
>
> B Linking the CRT statically.
> -> Increased size, problems with CRT state such as file descriptors.
>
> C Linking the CRT dynamically and bundling the MSVC redistributables
> with the extension.
> -> Even more increased size for the download, but smaller total
> footprint for extensions in sum; same CRT state problems.
>
> D Linking the CRT dynamically and providing an optional download and
> install of the redistributables if they're not present. This would
> best be done with some support from the Python installation machinery.
> -> Small nice size for extensions, still same CRT state problems.
>
> E As D + a new compiler-independent native code interface that
> does not carry dependencies on CRT state such as file descriptors, like
> JNI.
> -> Really huge effort, and cannot be applied until some new Python version.
>
> And I think the clue here is that the CRT state problems can be avoided
> by careful coding.
>
> Hence, for those who cannot do A I think B is a realistic practical
> option, and D would be nice...

Wait...

   F Possibly, as the docs say,

"Developer Studio will throw in a lot of import libraries that you do not really 
need, adding about 100K to your executable. To get rid of them, use the Project 
Settings dialog, Link tab, to specify ignore default libraries. Add the correct 
msvcrtxx.lib to the list of libraries."

Can anyone confirm whether this works in practice with MSVC 10?


Cheers,

- Alf

-- 
blog at <url: http://alfps.wordpress.com>



More information about the Python-list mailing list