Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C77DE47761B for ; Thu, 7 Nov 2002 09:48:14 -0500 (EST) Received: from relay-4v.club-internet.fr (relay-4v.club-internet.fr [194.158.96.115]) by postgresql.org (Postfix) with ESMTP id 4BD854774A3 for ; Thu, 7 Nov 2002 09:32:48 -0500 (EST) Received: from Club-Internet.fr (lns08v-6-156.w.club-internet.fr [212.194.161.156]) by relay-4v.club-internet.fr (Postfix) with ESMTP id 6D847169F; Thu, 7 Nov 2002 15:32:49 +0100 (CET) Message-ID: <3DCA7990.5010606@Club-Internet.fr> Date: Thu, 07 Nov 2002 15:32:48 +0100 From: Payman User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Whinston Cc: pgsql-interfaces@postgresql.org Subject: Re: Simple compile question References: <0565CAF35FADD64DA09B86C3637BE7291492C2@coex01.trans.corp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/15 X-Sequence-Number: 3263 Hi Stephan 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 -L/usr/local/pgsql/lib -lpq++ and for C build gcc -I/usr/local/pgsql/include -o testlibpqc testlibpqc.c -L/usr/local/pgsql/lib -lpq 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. Payman >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? > > >