X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 754E1D1B506 for ; Sun, 9 Nov 2003 17:36:43 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 02715-08 for ; Sun, 9 Nov 2003 13:36:12 -0400 (AST) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id C0EFFD1B509 for ; Sun, 9 Nov 2003 13:36:10 -0400 (AST) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 1AItTu-000KRu-0Z; Sun, 09 Nov 2003 17:36:10 +0000 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.24) id 1AItQl-00082b-MO; Sun, 09 Nov 2003 17:32:55 +0000 Subject: Re: error while executing a c program with embedded sql From: Oliver Elphick To: radha.manohar@ndsu.nodak.edu Cc: pgsql-novice@postgresql.org 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> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1068399145.2175.7.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sun, 09 Nov 2003 17:32:25 +0000 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/62 X-Sequence-Number: 8765 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