tags:

views:

129

answers:

2

I'm trying to do a debug build of the Rabbyt library using mingw's gcc to run with my MSVC built python26_d.. I got a lot of undefined references which caused me to create libpython26_d.a, however one of the undefined references remains. Googling gives me:

http://www.techlists.org/archives/programming/pythonlist/2003-03/msg01035.shtml

But -rdynamic doesn't help.

e:\MinGW/bin\gcc.exe -mno-cygwin -mdll -O -Wall -g -IE:\code\python\python\py26\
include -IE:\code\python\python\py26\PC -c rabbyt/rabbyt._rabbyt.c -o build\temp
.win32-2.6-pydebug\Debug\rabbyt\rabbyt._rabbyt.o -O3 -fno-strict-aliasing
rabbyt/rabbyt._rabbyt.c:1351: warning: '__Pyx_SetItemInt' defined but not used
writing build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.def

e:\MinGW/bin\gcc.exe -mno-cygwin -shared -g build\temp.win32-2.6-pydebug\Debug\r
abbyt\rabbyt._rabbyt.o build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.def -
LE:\code\python\python\py26\libs -LE:\code\python\python\py26\PCbuild -lopengl32
 -lglu32 -lpython26_d -lmsvcr90 -o build\lib.win32-2.6-pydebug\rabbyt\_rabbyt_d.
pyd
build\temp.win32-2.6-pydebug\Debug\rabbyt\rabbyt._rabbyt.o: In function `init_ra
bbyt':

E:/code/python/rabbyt/rabbyt/rabbyt._rabbyt.c:1121: undefined reference to `_imp
__Py_InitModule4'
A: 

My Cygwin and MinGW gcc installs were conflicting with each other. I deleted them both and the installed MinGW and cygwin without gcc and that solved the problem.

Mark
A: 

I got exactly the same problem here. I'm operating under Win7, trying to build an extension (written in C or C++) to python. After creating libpython26.a with "pexports" and "dlltool" most of the "undefined reference" errors are gone - but one: undefined reference to `imp_Py_InitModule4'. I did not install cygwin at all - only Python26 and MinGW.

thesaint4cs