pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kemin Zhou <kzhou@molsci.org>
To: pgsql-interfaces@postgresql.org
Subject: difficulty building the C++ interface
Date: Tue, 05 Jun 2001 11:16:33 -0700
Message-ID: <3B1D2201.FDE24D0A@molsci.org> (raw)

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





Message-ID: <3B1D2201.FDE24D0A@molsci.org>
Permalink:  ../3B1D2201.FDE24D0A@molsci.org/
Also on:    postgresql.org/message-id/3B1D2201.FDE24D0A@molsci.org

 · 

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: kzhou@molsci.org
  Subject: Re: difficulty building the C++ interface
  In-Reply-To: <3B1D2201.FDE24D0A@molsci.org>

* 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