473,505 Members | 15,626 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Building python C++ extension modules using MS VC++ 2005?

Dear list,

I have been using mingw to build a python extension module. I had to
jump through a number of hooks like the _ctype problem caused by the use
of msvcr71.dll, but the module was mostly usable.

Things become complicated when I use more and more boost libraries and
mingw can not work well with some of the modules. I am trying to switch
to VC but I was suggested that I need to use the identical version of VC
that is used to build python, which means VC7.1, 2003. However,
microsoft seems to stop distributing this version of VC, and its website
points me to VC expression 2005...

(http://msdn2.microsoft.com/en-us/visualc/aa336490.aspx)

Can I use the 2005 version to build python extension? What is the
official or recommended way to build python extension module under windows?

Many thank in advance.
Bo
Dec 21 '06 #1
3 1616
You can use 2005 to build extensions for Python 2.5. I've done this
with several extensions, both my own and others. I do not know if you
can use it for Python 2.4, so I won't advise you on that. I thought
Microsoft made its C/C++ compiler, version 7.1 (2003) freely available
as a command line tool. If you can't find it on their site, ask around,
I'm sure a lot of people have it. Probably you'll also find someone has
put it up somewhere if you search on google. Try 2005 first and see
what happens though.

-Sandra

Dec 22 '06 #2
Sure you can build extensions for Python2.4 with VS2005, I've always
done this way. And with Pyrex it is very very easy. Make sure to have a
look at Pyrex:

http://www.cosc.canterbury.ac.nz/gre...g/python/Pyrex

Dec 22 '06 #3
Sandra-24 wrote:
You can use 2005 to build extensions for Python 2.5. I've done this
with several extensions, both my own and others. I do not know if you
can use it for Python 2.4, so I won't advise you on that. I thought
Microsoft made its C/C++ compiler, version 7.1 (2003) freely available
as a command line tool. If you can't find it on their site, ask around,
I'm sure a lot of people have it. Probably you'll also find someone has
put it up somewhere if you search on google. Try 2005 first and see
what happens though.
But how exactly should I do it? I installed VC8 and get the all-familiar
error message: Python was built with Visual Stuidio 2003 ....

Actually, I get a copy of VC6/2003 but this compiler can not compile
boost 1.33.1/serialization so it can not be used to compile my extension
module.

Bo
Dec 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2406
by: Andreou Giannis | last post by:
Allthough it is possible to build modules in Python2.3.3 and distutils with cygwin, by running: setup.py build --compiler=cygwin (after i created the libpython23.a) running: setup.py install...
2
3735
by: Russell E. Owen | last post by:
I'm trying to build Python 2.3.4 from source on a RedHat Enterprise machine for installation in a net-wide accessible directory /net/python. I tried all of the following variants of ./configure...
0
577
by: Michael Ströder | last post by:
HI! I'm trying to build Python2.4 on a rather old Debian machine. I only have a shell account there. That's why I'm very limited in my actions. Building _socket fails (see below) although I...
0
289
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 407 open ( +1) / 3484 closed ( +5) / 3891 total ( +6) Bugs : 936 open ( +5) / 6363 closed (+14) / 7299 total (+19) RFE : 246 open...
32
2798
by: siggi | last post by:
@Ben Sizer Hi Ben, in January I received your message re Pygame and Python 2.5: As a Python (and programming ) newbie allow me a - certainly naive - question:
15
3187
by: kyosohma | last post by:
Hi, I am trying to get a small group of volunteers together to create Windows binaries for any Python extension developer that needs them, much like the package/extension builders who volunteer...
4
3124
by: Arnaud Delobelle | last post by:
Hi fellow python enthusiasts. Having recently acquired a MacBook Pro (Intel Core 2 Duo) which comes with python2.5, I have been installing some modules that I need (PIL, psycopg2, PyXML ...). ...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.