Compiling native extensions with Visual Studio 2012?

A

Alec Taylor

There have been various threads for MSVC 2010[1][2], but the most
recent thing I found for MSVC 2012 was [3]… from 6 months ago.

Basically I want to be able to compile bcrypt—and yes I should be
using Keccak—x64 binaries on Windows x64.

There are other packages also which I will benefit from, namely I
won't need to use the unofficial setup files and will finally be able
to use virtualenv.

So anyway, can I get an update on the status of MSVC 2010 and MSVC
2012 compatibility?

Thanks,

Alec Taylor

[1] http://bugs.python.org/issue13210
[2] http://webcache.googleusercontent.c...ki.python.org/moin/VS2010+&cd=1&hl=en&ct=clnk
[3] https://groups.google.com/d/topic/dev-python/W1RpFhaOIGk
 
W

wcdolphin

There have been various threads for MSVC 2010[1][2], but the most

recent thing I found for MSVC 2012 was [3]… from 6 months ago.



Basically I want to be able to compile bcrypt—and yes I should be

using Keccak—x64 binaries on Windows x64.



There are other packages also which I will benefit from, namely I

won't need to use the unofficial setup files and will finally be able

to use virtualenv.



So anyway, can I get an update on the status of MSVC 2010 and MSVC

2012 compatibility?



Thanks,



Alec Taylor



[1] http://bugs.python.org/issue13210

[2] http://webcache.googleusercontent.c...ki.python.org/moin/VS2010+&cd=1&hl=en&ct=clnk

[3] https://groups.google.com/d/topic/dev-python/W1RpFhaOIGk

Besides the deep technicality of potential conflicts, two changes will allow you to compile your C extension. msvc9compiler.py is written only lookingfor VS2010, and even if you have vs2010 installed, it will still fail on Windows 7, Windows 8 with silly manifest errors.

The fix is simple:
In: Python27/Lib/distutils/msvc9compiler.py,
line#648 in definition of "link", before the call to "ld_args.append('/MANIFESTFILE:' + temp_manifest)",insert:
ld_args.append('/MANIFEST')

line#178 in the definition of "get_build_version", insert:
return 11.0
 
W

wcdolphin

There have been various threads for MSVC 2010[1][2], but the most

recent thing I found for MSVC 2012 was [3]… from 6 months ago.



Basically I want to be able to compile bcrypt—and yes I should be

using Keccak—x64 binaries on Windows x64.



There are other packages also which I will benefit from, namely I

won't need to use the unofficial setup files and will finally be able

to use virtualenv.



So anyway, can I get an update on the status of MSVC 2010 and MSVC

2012 compatibility?



Thanks,



Alec Taylor



[1] http://bugs.python.org/issue13210

[2] http://webcache.googleusercontent.c...ki.python.org/moin/VS2010+&cd=1&hl=en&ct=clnk

[3] https://groups.google.com/d/topic/dev-python/W1RpFhaOIGk

Besides the deep technicality of potential conflicts, two changes will allow you to compile your C extension. msvc9compiler.py is written only lookingfor VS2010, and even if you have vs2010 installed, it will still fail on Windows 7, Windows 8 with silly manifest errors.

The fix is simple:
In: Python27/Lib/distutils/msvc9compiler.py,
line#648 in definition of "link", before the call to "ld_args.append('/MANIFESTFILE:' + temp_manifest)",insert:
ld_args.append('/MANIFEST')

line#178 in the definition of "get_build_version", insert:
return 11.0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top