I am having a lot of trouble in building the C++ interface to 7.1

I could build it.

But when I tried to build the test programs I have to add

#inlcude <libpq-fe.h>

to my source code because the libpq++ depends on libpq. The objects
of libpq++ does not include libpq-fe.

I could build my test program with the follwing makefile

Here is the first few lines of the test file

=========================
#include <iostream.h>
#include <libpq++.h>
#include <libpq-fe.h>
#include <crypt.h>

int main() {
char state_code[3];
char query_string[256];
PgDatabase data("dbname=testdb");;
======================================

Here is the makefile:

HEADERDIR= /usr/local/pgsql/include
LIBPQDIR= /usr/local/pgsql/lib

CXXFLAGS= $(CFLAGS)
CXXFLAGS+= -I $(HEADERDIR)
LDFLAGS+= -L $(LIBPQDIR) -lpq++ -lpq

testlpq : tlibpq.cpp
g++ $(CXXFLAGS) -o $@ $? $(LDFLAGS)

==================
make went well

But I got this message:
when run the binary

[kzhou@rabbit testpgsql]$ testlpq
testlpq: error in loading shared libraries: libpq++.so.3: cannot open
shared object file: No such file or directory

my /usr/local/pgsql/lib dir apparently has all these files
[kzhou@rabbit lib]$ ls
libecpg.a libpgeasy.a libpq++.a libpq.a
plpgsql.so
libecpg.so libpgeasy.so libpq++.so libpq.so
libecpg.so.3 libpgeasy.so.2 libpq++.so.3 libpq.so.2
libecpg.so.3.2.0 libpgeasy.so.2.1 libpq++.so.3.1 libpq.so.2.1

Can someone give me some help?

Is the C++ inter face in a usable format?

Should I waste time on this interface?

Kemin

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-interfaces @
categoriespostgresql
postedJun 11, '01 at 1:34p
activeJun 11, '01 at 1:34p
posts1
users1
websitepostgresql.org
irc#postgresql

1 user in discussion

Kemin Zhou: 1 post

People

Translate

site design / logo © 2022 Grokbase