473,326 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Python 2.3 distutils with Mingw C++

In Python 2.2, I compiled some C++ code on Windows (MinGW compiler) to
create an extension using distutils and the following setup.py file:

from distutils.core import setup, Extension
setup (name = "_pysimple",
version = "1.0",
maintainer = "AG",
maintainer_email = "xx*@xx.co.uk",
description = "Sample Python C++ DLL",
ext_modules = [Extension('_pysimple',

extra_compile_args=['-O2','-march=i586','-malign-double'],
extra_link_args=['-mthread'],
library_dirs=['C:\\mingw\\lib'],
libraries=['supc++'], # if using iostreams etc.
use stdc++
sources=['pysimple_wrap.cxx'])])

Provided that certain C++ features such as templates were not used,
this would build ok using the gcc compiler (not g++), as supc++ is
linked to.
Command used is: python setup.py build --compiler=mingw32

In Python 2.3, distutils recognises the .cxx extension as C++ and
tries to compile with
cc -mno-cygwin -shared etc.
resulting in "cc not found" error message. It should compile with
c:\mingw\bin\gcc -mno-cygwin -shared etc.
or *much* better
c:\mingw\bin\g++ -mno-cygwin -shared etc.

The quick fix is to copy the old distutils subdirectory from Python22
into Python23.

Andrew.
Jul 18 '05 #1
0 1551

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

Similar topics

3
by: David Isal | last post by:
hi all, i'm new to python and i'm trying to build a python extension on win98, written in c++, with cygwin. but i keep having the same error message, and i didnt't find much resources on the web...
2
by: C. Barnes | last post by:
Normally, one uses the following procedure to build and install a C/C++ extension: python setup.py build --compiler=your_compiler python setup.py install For Python 2.3.3 on Windows, with...
15
by: Christos TZOTZIOY Georgiou | last post by:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes, please let me know, since I can't test a couple of my apps using PIL with 2.4 . You can even reply by email (yes, I dare use true...
3
by: Olivier Ravard | last post by:
Hi, When I tryed to compile a python module using distutils under windows, and there is an error message if we do not have Microsoft Visual C++ 6 installed. This is because python have been...
66
by: Srijit Kumar Bhadra | last post by:
Is there any specific reason for not using MinGW to build the official distribution of Python for Win32? A quick Google search did not reveal the answer to my question. If a link is available,...
1
by: Srijit Kumar Bhadra | last post by:
I have browsed the following links 1) http://peak.telecommunity.com/DevCenter/EasyInstall 2) When Python *Eggs* better than Python *distutils*?? What's Eggs? (http://tinyurl.com/m8dyd) But I am...
4
by: vedrandekovic | last post by:
Hi, I have already install Microsoft visual studio .NET 2003 and MinGw, when I try to build a extension: python my_extension_setup.py build ( or install ) , I get an error: LINK : fatal...
15
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...
1
by: David Cournapeau | last post by:
Hi, I am trying to make numpy build with python 2.6 on windows, and it has been a bumpy road. Building with MS tools works OK, but building with mingw is still problematic. The problems are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.