Ilmar Wilbers <ilm...@...> writes:

> 
> Hi,
> 
> I am having some serious problems with the C API declarations, chapter 
> 7.2.2 i n the manual.
> 
> Using the exact two example files does not work for me, I keep getting:
> marty.c:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
> before ‘car’
> marty.c: In function ‘main’:
> marty.c:7: error: ‘car’ undeclared (first use in this function)
> marty.c:7: error: (Each undeclared identifier is reported only once
> marty.c:7: error: for each function it appears in.)
> 
<snip>
> Is there a problem with the header files that I don't understand? I run 
> Cython on delorean.pyx before running
> gcc -c -I/usr/include/python2.5 -lpython2.5 marty.c
> 
> Has anyone tried these examples lately?
> 
> Sincerly, Ilmar
> 

I ran into the same problem with the delorean example.  I can get marty.c to
compile by changing

Vehicle car;

to 

struct Vehicle car;

Getting it to run is another story. It dies deep inside import_delorean(). 
Heres a trace from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xb7ea7ac7 in PyEval_GetGlobals () from /usr/lib/libpython2.5.so.1.0
#2  0xb7ec9187 in PyImport_Import () from /usr/lib/libpython2.5.so.1.0
#3  0x08048797 in __Pyx_ImportModule (name=0x8048bc7 "delorean")
    at delorean_api.h:24
#4  0x08048984 in import_delorean () at delorean_api.h:73
#5  0x08048a3e in main (argc=3, argv=0xbfdbfa34) at marty.c:6

I'm building with gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3) using the same command
line as Ilmar.

Anyone know what might be going wrong?

Thanks,
Mike



_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to