Message18790
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.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:17:54 | admin | link | issue832159 messages |
2007-08-23 14:17:54 | admin | create | |
|