[Pyrex] was: problem with void*....

Geoffrey Bantle hairbat at yahoo.com
Wed Jun 18 18:37:38 CEST 2003


>Something wrong with my understanding :)

Nah, more likley something wrong with my code ;)

>Are you sure you are dealing with triple pointer:
>***void
>It's pretty uncommon unless you have deeply nested
>structures or 
>multidim
>arrays.

Eeek! Yeah I think I see what I did wrong there. I
changed it and it seems to compile now except for some
other errors (see below)

>And when you try to deref Session you're passing
>plain void through 
>Python
>which no
>compiler know how to cope with.

>Please post original C API of that part and then your
>code.

>Mike

This is the typedef of VSession from vll.h:
typedef void *		VSession;
(I assume this is meant to be typedef void* (no
space), which is how I wrote it in the pyrex cdef
extern block)

heres the function prototype for what I am currently
trying to wrap.

extern void vll_send_connect(char *name, char *pass,
void *address, VSession * *connection);
(once again I assume theres not supposed to be a space
and this should be **connection, regardless the C lib
compiles fine.)

heres the (slightly changed) pyrex code.

cdef VSession createSession():
	cdef VSession Connection
	return Connection
cdef class pvlSession:
	def __init__(self):
		self.Connection = createSession()
	def describe(self):
		print "this Session is", self.Connection

def pvl_send_connect(User,Password,Address,Vsession
Session):
	vll_send_connect(User,Password,Address,&Session)

These are the errors I get when compiling now (no more
complaining about Void...)

vll.c: In function `__pyx_f_10pvlSession_describe':
warning: implicit declaration of function `None'
vll.c:92: warning: assignment makes pointer from
integer without a cast
vll.c: In function `__pyx_f_pvl_send_connect':
warning: assignment makes pointer from integer without
a cast	

And of course (in keeping with the problem of
'implicit decleration of function 'None') it gives the
following error when trying to link: 
"Undefined reference to 'None'"

I'm not sure about the pointer/cast warning, Iv'e
gotten those sorts of things when compiling stuff with
swig and it seemed OK (not sure though). It seems the
crux of the matter now is the undefined reference to
'None'. theres a None function referenced in the C
file produced by pyrex, but where its supposed to come
from I can't say.

Anyway thanks for all the help everyone!

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com




More information about the Pyrex mailing list