pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: radha.manohar@ndsu.nodak.edu
Cc: pgsql-novice@postgresql.org
Subject: Re: error while executing a c program with embedded sql
Date: Sun, 09 Nov 2003 17:32:25 +0000
Message-ID: <1068399145.2175.7.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <3324.134.129.110.96.1068390374.squirrel@webmail.ndsu.nodak.edu>
References: <3324.134.129.110.96.1068390374.squirrel@webmail.ndsu.nodak.edu>

On Sun, 2003-11-09 at 15:06, radha.manohar@ndsu.nodak.edu wrote:
> I have a c program called test1.pgc with some sql statements embedded in
> it. The program was preprocessed, compiled and linked. Now, I have the
> executable test1.
> 
> When I run the executable it says,
> 
> ./test1: error while loading shared libraries: libecpg.so.3: cannot open
> shared object file: No such file or directory
> 
> What does it mean by this error message? What should I do to correct this
> error and run the executable successfully?

Shared libraries are loaded from directories specified to the system by
ldconfig.  Your shared library, libecpg.so.3, is in a PostgreSQL
directory, such as /usr/local/pgsql/lib, which has not been added to the
directories known to the loader.

If you are able to add that directory with ldconfig, that is the best
way to do it, but it requires root privilege.

Otherwise you can set the environment variable LD_LIBRARY_PATH, thus:

	export LD_LIBRARY_PATH=/usr/local/pgsql/lib

before you run the program, or you can use LD_PRELOAD:

	LD_PRELOAD=/usr/local/pgsql/lib/libecpg.so.3 ./test1

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "O death, where is thy sting? O grave, where is 
      thy victory?"             1 Corinthians 15:55 




view thread (5+ messages)  latest in thread

Message-ID: <1068399145.2175.7.camel@linda.lfix.co.uk>
Permalink:  ../1068399145.2175.7.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1068399145.2175.7.camel@linda.lfix.co.uk

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: olly@lfix.co.uk, radha.manohar@ndsu.nodak.edu, pgsql-novice@postgresql.org
  Subject: Re: error while executing a c program with embedded sql
  In-Reply-To: <1068399145.2175.7.camel@linda.lfix.co.uk>
  References: <3324.134.129.110.96.1068390374.squirrel@webmail.ndsu.nodak.edu> <1068399145.2175.7.camel@linda.lfix.co.uk>

* 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