I am using Postgresql on MacOS X with gnu 3.1
I am using this for C++ builds
g++ -I/usr/local/pgsql/include -o testlibpq0 testlibpq0.cc
and for C build
gcc -I/usr/local/pgsql/include -o testlibpqc testlibpqc.c
You sample is C++ or C prog ?
if is C prog are you include libpq-fe.h in you source code ?
PGconn is defined in this header.
>I just installed pgsql this morning and already encountered some difficulties. How do I compile a C/C++ client application with pgsql? Here's what I do:
>gcc -c -I/usr/local/pgsql/include sample.cpp
>and I get:
>aggregate 'PGconn conn' has incomplete type and cannot be initialized
>aggregate 'PGresult res' has incomplete type and cannot be initialized
>The libpq-fe.h file *is* in /usr/local/pgsql/include
>What other include files am I missing?
>Also, a lot of messages seem to indicate that there is sample code under the src/ dir. Where is this? It is not under /usr/local/pgsql. Did I miss a step in the install?
In response to
pgsql-interfaces by date
|Next:||From: Tom Lane||Date: 2002-11-07 15:27:19|
|Subject: Re: Simple compile question |
|Previous:||From: Payman||Date: 2002-11-07 14:23:32|
|Subject: Re: PQcmdTuples() declaration|