logo       

Struggling with "Hello World" Extension type: msg#00038

python.pyrex

Subject: Struggling with "Hello World" Extension type

Hi All,

I'm trying to learn how to use Pyrex by wrapping a few functions from
the libpq library. I started with the following...

cdef extern from "libpq-fe.h":
ctypedef enum ConnStatusType:
CONNECTION_OK
CONNECTION_BAD
ctypedef struct PGconn
....
PGconn *PQconnectdb(char *conninfo)

cdef class Connection:
...
cdef PGconn *conn

def __new__(self, conninfo):
self.conn = <PGconn*>PQconnectdb(conninfo)

This compiles fine but when you try to import the .so file, you get

"Import Error: ./libpq.so: undefined symbol: PQconnectdb".

I've googled for code that does similar things and I can't see what I'm doing
differently. Can anyone point me in the right direction?

Thanks,
Andy



___________________________________________________________
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" � The
Wall Street Journal
http://uk.docs.yahoo.com/nowyoucan.html


_______________________________________________
Pyrex mailing list
Pyrex@xxxxxxxxxxxxxxxxx
http://lists.copyleft.no/mailman/listinfo/pyrex
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise