Author alydar
Recipients
Date 2003-10-29.04:27:08
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Using the following three files:

-- begin files -----
/* hello.cpp */
#include <stdio.h>
void hello()
{
    printf("hello world\n");
}
------------------
/* hello.i */
%module hello
extern void hello();
------------------
# setup.py
import distutils
from distutils.core import setup, Extension

setup(name = "Hello World",
        version = "1.0",
        ext_modules = [Extension("_hello",
            ["hello.i","hello.cpp"])])
-- end files -------


executing the command:
 "python setup.py build_ext -cmingw32 --swig-cpp -f"
creates the following output:

-- begin output --
running build_ext
building '_hello' extension
swigging hello.i to hello_wrap.cpp
...
[ snipped ]
...
cc -mno-cygwin -shared -s build\temp.win32-2.3
\Release\hello_wrap.o build\temp.w
in32-2.3\Release\hello.o build\temp.win32-2.3
\Release\_hello.def -LC:\p\Python23
\libs -LC:\p\Python23\PCBuild -lpython23 -o 
build\lib.win32-2.3\_hello.pyd
error: command 'cc' failed: No such file or directory
-- end output --

It appears that unixccompiler.py defaults compiler_cxx 
to use "cc" and then uses it for the linking, and 
cygwinccompiler.py does not override the compiler_cxx 
entry.  If the self.set_executable() call in the __init__*( 
function of the Mingw32Compiler class also sets 
compiler_cxx to use "g++", then the extension build will 
work.

History
Date User Action Args
2007-08-23 14:17:54adminlinkissue832159 messages
2007-08-23 14:17:54admincreate