syntax errors while building pypgsql

Carsten Haese carsten at uniqsys.com
Wed Nov 23 09:02:26 EST 2005


On Wed, 2005-11-23 at 08:01, Tin Gherdanarra wrote:
> Hallo,
> 
> I'm trying to install pypgsql. However, I get syntax errors
> while compiling the C sources. The following excerpt
> from pgconnection.h looks a little funny to me:
> 
> typedef struct {
>      PyObject_HEAD /* Here is the syntax error, and rightly so */
>      PGconn *conn;
>      PyObject *host;
>      PyObject *port;
>      PyObject *db;
>      PyObject *options;
>      PyObject *tty;
>      PyObject *user;
>      PyObject *pass;
>      PyObject *bePID;
>      PyObject *socket;
>      PyObject *version;
>      PyObject *notices;
>      PyObject *cinfo;
>      int showQuery;
> } PgConnection;
> 
> 
> I don't know what PyObject_HEAD or PGconn is,
> but if they are types, a syntax error is justified here:

PyObject_HEAD is not a type, it is a macro that defines struct members
that all Python objects have in common. The macro definition has a
semicolon at the end, so when the macro is expanded, the result is
syntactically correct, even though the above looks wrong on the surface.

What error messages are you actually getting? If you are getting a long
list of errors, please give us the first few rather than the last few.

-Carsten





More information about the Python-list mailing list