pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Simple compile question
3+ messages / 3 participants
[nested] [flat]

* Simple compile question
@ 2002-11-06 21:42 Stephen Whinston <swhinston@pillardata.com>
  2002-11-07 14:32 ` Re: Simple compile question Payman <payman@Club-Internet.fr>
  2002-11-07 15:27 ` Re: Simple compile question Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: Stephen Whinston @ 2002-11-06 21:42 UTC (permalink / raw)
  To: pgsql-interfaces


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?

thanks,
Stephen



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Simple compile question
  2002-11-06 21:42 Simple compile question Stephen Whinston <swhinston@pillardata.com>
@ 2002-11-07 14:32 ` Payman <payman@Club-Internet.fr>
  1 sibling, 0 replies; 3+ messages in thread

From: Payman @ 2002-11-07 14:32 UTC (permalink / raw)
  To: Stephen Whinston <swhinston@pillardata.com>; +Cc: pgsql-interfaces

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?
>
>  
>






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Simple compile question
  2002-11-06 21:42 Simple compile question Stephen Whinston <swhinston@pillardata.com>
@ 2002-11-07 15:27 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2002-11-07 15:27 UTC (permalink / raw)
  To: Stephen Whinston <swhinston@pillardata.com>; +Cc: pgsql-interfaces

"Stephen Whinston" <swhinston@pillardata.com> writes:
> gcc -c -I/usr/local/pgsql/include sample.cpp
> aggregate 'PGconn conn' has incomplete type and cannot be initialized
> aggregate 'PGresult res' has incomplete type and cannot be initialized

Where did you get this "sample.cpp" from?  It appears to be written
incorrectly.

> Also, a lot of messages seem to indicate that there is sample code
> under the src/ dir. Where is this?

Look in the source-code distribution.  I don't believe we install any
sample code; there's no standard place for examples in the usual system
directories.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-11-07 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 21:42 Simple compile question Stephen Whinston <swhinston@pillardata.com>
2002-11-07 14:32 ` Payman <payman@Club-Internet.fr>
2002-11-07 15:27 ` Tom Lane <tgl@sss.pgh.pa.us>

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