RE: [INTERFACES] RE: libpq++ and gcc - Mailing list pgsql-interfaces

From Josh Friess
Subject RE: [INTERFACES] RE: libpq++ and gcc
Date
Msg-id 01BDF1A1.A9242970.jjfriess@vicidesign.com
Whole thread Raw
List pgsql-interfaces
Hi everyone,

I sent mail to these lists about a month ago, and got a few responses about
the same thing.  Apparently my mail system was down, but now it's up again.

I have written several applications for use with postgres.  All of them
compile; none of them link.  They all raise undefined symbol errors during
the linking phase because I'm not linking properly with the libpq++
library.

I originally had installed postgres6.3.2 via an rpm from RedHat.  Today I
downloaded the tar.gz'ed source and followed the installation instructions
exactly.  I finished, and tried compiling/linking my code using the -lpq
and -lpq++ options, and neither of them worked.

I am a novice to g++.  I know about 4 flags, and for the most part (until
now) I have gotten by fine.  I really don't know how to configure this
properly.  The documentation on libpq/++ is limited.  Could someone please,
please help me?  I have no idea where to go from here...

------------------------------------------------
Josh Friess
Vici Design, LLC.
jjfriess@vicidesign.com
http://www.vicidesign.com

-----Original Message-----
From:    Joris Esch [SMTP:joris.esch@esat.kuleuven.ac.be]
Sent:    Wednesday, October 07, 1998 7:46 AM
To:    pgsql-interfaces@postgreSQL.org
Subject:    [INTERFACES] RE: libpq++ and gcc

Hello everybody:

KaDe wrote:

Did you get an answer ?

I think the problem is a question of path ...
you have to add something as  -L.. -pq -pq++ as parameters for your gcc
command.
I can't remember precisely, have a look in the makefile of the libpq++
directory and try to guess.
I resolved the problem of the path access copying all the headers files of
postgres 1 level of directory upper.
I'm sure there is a smarter way, but I've not yet found it.

I hope this can help you:

in /etc/profile,  i have:
PGLIB=/usr/lib
export PGLIB

My headers are in /usr/include. There i have a libpq++.h which i
 #include.

Then, when i compile i type e.g.:

c++ test_pgsql_libpq++.cpp -o test_pgsql_libpq++ -lpq++ -lpq (Lowercase L)

If your headers are elsewhere, try -I/my_header_directory (Uppercase i ).

I use egcs, but it doesn't differ much from gcc,  i think.

good luck
joris
--
joris esch, student in electrical engineering
        Power is knowledge.


pgsql-interfaces by date:

Previous
From: Joris Esch
Date:
Subject: RE: libpq++ and gcc
Next
From: Josh Friess
Date:
Subject: just noticed something about libpq++ linking...