A hack to let Pyrex 0.3.x users build extension classes on Win32

David LeBlanc whisper at oz.net
Fri Jul 5 16:42:45 EDT 2002


Making pyrexc use native (Visual C) compiler:

GCC_BIN_DIR = 'd:/visstudio/vc98/bin'
PYREX_DIR = 'j:/python22/apps/Pyrex0.3.3'
PYTHON_VERSION = 'python22'
PYTHON_DIR = 'j:/' + PYTHON_VERSION
.
.
.
def compile(name):
	print '\ncompile'
	cmd('cl -I%s/include -c %s.c -o %s.o'  % (PYTHON_DIR, name, name))
.
.
.
def wrap(name):
	print '\nwrap'
	cmd('link /DLL /SUBSYSTEM:console /DEF:%s.def /OUT:%s.pyd /LIBPATH:%s/libs
%s.lib %s.obj' %
		(name, name, PYTHON_DIR, PYTHON_VERSION, name))

Obviously, you'll need to change the path definitions to suit your
particular installation.

I did not encounter the initializer problem described by Greg Fawcett. This
may differ if you do more then compile the supplied demos, which is all i've
done so far.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Greg Ewing
> Sent: Thursday, July 04, 2002 19:07
> To: python-list at python.org
> Subject: Re: A hack to let Pyrex 0.3.x users build extension classes on
> Win32
>
>
> Graham Fawcett wrote:
>
> > I ran into a hitch when trying to build an extension class on
> > my Win32 machine: the compiler complained with "initializer not a
> > constant" errors. This is a known issue in Python; see the FAQ at
> > http://www.python.org/cgi-bin/faqw.py?req=show&file=faq03.024.htp .
>
>
> Thanks for pointing this problem out. I'll see if I can
> do something about this in a future release.
>
> --
> Greg Ewing, Computer Science Dept,
> University of Canterbury,
> Christchurch, New Zealand
> http://www.cosc.canterbury.ac.nz/~greg
>
> --
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list