errors compiling c++ extensions with swig on windows
Hi, using the following setup file to build a extension from c++ source on windows/mingw with swig 1.3.31, import distutils from distutils.core import setup, Extension ext = Extension("_libpyorigin", ["libpyorigin.i","OPJFile.cpp"], extra_compile_args = ['-w']) setup(name = "libpyorigin", version = "0.1", options={'build_ext':{'swig_opts':'-c++'}}, ext_modules = [ext]) I get the following error: $ python setup.py build_ext --compiler=mingw32 running build_ext building '_libpyorigin' extension swigging libpyorigin.i to libpyorigin_wrap.cpp C:\msys\1.0\local\bin\swig.exe -python -c++ -o libpyorigin_wrap.cpp libpyorigin.i c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ic:\Python25\include -Ic:\Python25\PC -c libpyorigin_wrap.cpp -o build\temp.win32-2.5\Release\libpyorigin_wrap.o -w writing build\temp.win32-2.5\Release\_libpyorigin.def c:\mingw\bin\g++.exe -mno-cygwin -mdll -static --entry _DllMain@12 --output-lib build\temp.win32-2.5\Release\lib_libpyorigin.a --def build\temp.win32-2.5\Release\_libpyorigin.def -s build\temp.win32-2.5\Release\libpyorigin_wrap.o build\temp.win32-2.5\Release\opjfile.o -Lc:\Python25\libs -Lc:\Python25\PCBuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\_libpyorigin.pyd g++: build\temp.win32-2.5\Release\lib_libpyorigin.a: No such file or directory error: command 'g++' failed with exit status 1 What is distutils trying to do with that lib_libpyorigin.a? I could not find the meaning of --output-lib but I suspect g++ is trying to link with that lib but it was meant to build it, right? Is this a bug in distutils or did I do seomething wrong? The same works perfectly on linux, btw. Thanks, Christian
participants (1)
-
Christian K.