difficulty building the C++ interface - Mailing list pgsql-interfaces

From Kemin Zhou
Subject difficulty building the C++ interface
Date
Msg-id 3B1D2201.FDE24D0A@molsci.org
Whole thread Raw
List 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@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




pgsql-interfaces by date:

Previous
From: James Loh
Date:
Subject: Re: Postgresql unit
Next
From: Sandro Dentella
Date:
Subject: How to determine PRIMARY KEYS