pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Friess <jjfriess@vicidesign.com>
To: 'joris.esch@esat.kuleuven.ac.be' <joris.esch@esat.kuleuven.ac.be>
Cc: 'pgsql-interfaces@postgresql.org' <pgsql-interfaces@postgresql.org>
Cc: 'pgsql-novice@postgresql.org' <pgsql-novice@postgresql.org>
Subject: RE: [INTERFACES] RE: libpq++ and gcc
Date: Wed, 7 Oct 1998 03:22:02 -0500
Message-ID: <01BDF1A1.A9242970.jjfriess@vicidesign.com> (raw)

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.
	



view thread (2+ messages)  latest in thread

Message-ID: <01BDF1A1.A9242970.jjfriess@vicidesign.com>
Permalink:  ../01BDF1A1.A9242970.jjfriess@vicidesign.com/
Also on:    postgresql.org/message-id/01BDF1A1.A9242970.jjfriess@vicidesign.com

 · 

reply

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: jjfriess@vicidesign.com, joris.esch@esat.kuleuven.ac.be, pgsql-novice@postgresql.org
  Subject: RE: [INTERFACES] RE: libpq++ and gcc
  In-Reply-To: <01BDF1A1.A9242970.jjfriess@vicidesign.com>

* 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