[Pyrex] Struggling with "Hello World" Extension type

Andrew Chambers andychambers2002 at yahoo.co.uk
Wed Jun 21 18:12:24 UTC 2006


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




More information about the Pyrex mailing list