This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Problem linking on windows using mingw32 and C++
Type: Stage:
Components: Distutils Versions: Python 2.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: devilwolf, dobesv, woodsplitter
Priority: normal Keywords:

Created on 2004-09-15 17:28 by devilwolf, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg22453 - (view) Author: Steve Menard (devilwolf) Date: 2004-09-15 17:28
When create a python extension in C++ and using ming32
to compile it, distutil will try to use 'cc' as the linker.

The problem is that the CCompiler.link() method will
substitude the linker it has found in linker_exe or
linker_so with the first part of compiler_cxx. (lines
175-176)

So adding the following line to Mingw32Compiler, near
line 296

compiler_cxx='g++ -mno-cygwin -O -Wall',

Fixes it for me. 

Quickly looking at the CygwinCompiler indicates it
would suffer from he same problem.
msg22454 - (view) Author: David S. Rushby (woodsplitter) Date: 2004-09-17 16:15
Logged In: YES 
user_id=414645

Is this a duplicate of the following two bug reports?
http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=877165
http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=832159

The first of those two was closed with a notice that the
patch is in CVS; the second is still open.
msg22455 - (view) Author: Steve Menard (devilwolf) Date: 2004-09-18 17:54
Logged In: YES 
user_id=423569

Indeed it does seem identical to
http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=877165

thanks.
msg22456 - (view) Author: Dobes V (dobesv) Date: 2007-05-22 19:30
This is a duplicate of 832159.  See the comments in that one for a workaround that doesn't require patching your distutils sources.

Note that for cygwin, you can set some environment variables to change the compiler/linker.  This doesn't work in mingw32 due to a bug in distutils.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40916
2008-01-04 01:16:26christian.heimessetstatus: open -> closed
resolution: duplicate
2004-09-15 17:28:53devilwolfcreate