[Pyrex] Newbie question

JC jc.gigogne at wanadoo.fr
Thu Aug 5 11:37:42 CEST 2004


Fisrt excuse me for my poor english...my mother tongue is french...

It could seems to be an 'idiot' question but my problem is quite simple:
How to write one single extension (let's say 'mycommoncasses.pyd) from several .pyx sources containing python classes ?
I already wrote one file 'build.py' called by with 'python build.py' containing:

from distutils.core import setup
from distutils.extension import Extension
from Pyrex.Distutils import build_ext

import sys

sys.argv.append("build_ext")
sys.argv.append("--inplace")
sys.argv.append("--compiler=mingw32")
setup(
	name = "myClasses",
	ext_modules=[ 
	Extension("mycommoncasses", ["someclasses.pyx","otherclasses.pyx"])
	],
	cmdclass = {'build_ext': build_ext}
)

but it fails like this:
d:\cygwin\bin\gcc.exe -mno-cygwin -mdll -static -s build\temp.win32-2.2\Release\
someclasses.o build\temp.win32-2.2\Release\otherclasses.o build\temp.win32-2.2\Release\mycommoncasses.def -Lc:\Python22\libs -lpython22 -o mycommoncasses.pyd
Cannot export initmycommoncasses: symbol not defined
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1


Thanks in advance,
JC





More information about the Pyrex mailing list