From: Payman <payman@Club-Internet.fr>
To: Stephen Whinston <swhinston@pillardata.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Simple compile question
Date: Thu, 07 Nov 2002 15:32:48 +0100
Message-ID: <3DCA7990.5010606@Club-Internet.fr> (raw)
References: <0565CAF35FADD64DA09B86C3637BE7291492C2@coex01.trans.corp>
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?
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: payman@Club-Internet.fr, swhinston@pillardata.com
Subject: Re: Simple compile question
In-Reply-To: <3DCA7990.5010606@Club-Internet.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox