[Pyrex] Main function for Pyrex: cimport causes segmentation fault

len-l at telus.net len-l at telus.net
Fri Apr 15 20:30:21 CEST 2005


On 15 Apr 2005 at 11:38, Alain Pointdexter wrote:

> The example i gave contained an empty dishes.pyx
> I then tried to to fill it with some useful stuf.
> Here are the files:
[Snip some code]
> # restaurant.pyx
> 
You need the following line here:

include "main.pxi"

> from dishes cimport Testclass
> cdef test_function():
> printf("Instantiating Testclass\n")
> testobj =Testclass()
> printf("testmain: created testobj\n")
> print "testobj.someint = %s" % testobj.someint
> print "testobj.somestring = %s" % testobj.somestring
> print "calling testobj.hello()"
> testobj.hello()
> 
> def main(arglist):
> test_function()
> return 0
> The compilation sequence is the same as in the
> previous mail.
> Running the application causes a segmentation fault.
> 
I am using Visual C 6.0 and Python 2.3 it ran for me. The
call to "printf" raise an exception (printf is a C routine, not
Pyrex, so is undefined) but that was reported as an uncaught
exception by Python (no segmentation fault).

See my  reply to your other posting, where you describe your
build process, for a suggestion on why you are having problems.

Lenard Lindstrom
<len-l at telus.net>




More information about the Pyrex mailing list