difficulty building the C++ interface

From: Kemin Zhou <kzhou(at)molsci(dot)org>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: difficulty building the C++ interface
Date: 2001-06-05 18:16:33
Message-ID: 3B1D2201.FDE24D0A@molsci.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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(at)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(at)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

Browse pgsql-interfaces by date

  From Date Subject
Next Message pgsql-interfaces 2001-06-05 18:17:06 Re: libpq++ in Apache Problem.
Previous Message Magnus Hagander 2001-06-05 14:47:02 RE: [DOCS] Re: libpq sockets on win32