473,804 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_emai l = "xx*@xx.co. uk",
description = "Sample Python C++ DLL",
ext_modules = [Extension('_pys imple',

extra_compile_a rgs=['-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=mingw3 2

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\gc c -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 1572

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

Similar topics

3
4520
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 about it: >g++ -I/cygdrive/c/python22/include -c demomodule.cpp -o demomodule.o In file included from /cygdrive/c/python22/include/Python.h:62, from demomodule.cpp:1: /cygdrive/c/python22/include/pyport.h:480:2: #error "LONG_BIT definition
2
4264
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 the Mingw (Minimalist GNU) compiler, the following steps must be taken:
15
2220
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 email in newsgroup postings, but then, I'm postmaster and welcome spam :) TIA -- TZOTZIOY, I speak England very best, "Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
3
2433
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 compiled with MSVC6 and distutils wants it in order to compile C++ python modules. One of the reasons why I use python is because this is a free language. But I need
66
5506
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, please post it. Best Regards, Srijit
1
2155
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 still not clear what to do with an .egg file. For example, if I have a basic Python installation (http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi) what should I do with a typical .egg file (e.g....
4
2539
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 error LNK1141: failure during build of exports file error: command '"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe"' failed with exit status 1141.What shoud I
15
3232
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 their time to create Linux RPMs. The main thing I need are people willing to test the binaries to make sure the extension is stable. This would require installing the binary and probably downloading the source too to get the developer's test
1
4087
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 linked to manifest, and msvcr versions issues. Here is my understanding and how far I got: - python 2.6 is built with VS 2008, and msvcr 9: numpy has to be built against the exact same runtime to work. - msvcr 9 is not publicly available on most...
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
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 we have to send another system
3
3001
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.