Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A3B0E4771B4 for ; Fri, 27 Sep 2002 08:56:07 -0400 (EDT) Received: from smtp-server3.tampabay.rr.com (smtp-server3.tampabay.rr.com [65.32.1.41]) by postgresql.org (Postfix) with ESMTP id 8DD4E476EAA for ; Fri, 27 Sep 2002 08:54:25 -0400 (EDT) Received: from shamrock (47.80.35.65.cfl.rr.com [65.35.80.47]) by smtp-server3.tampabay.rr.com (8.12.2/8.12.2) with ESMTP id g8RCsPrn004891; Fri, 27 Sep 2002 08:54:25 -0400 (EDT) Date: Fri, 27 Sep 2002 08:54:24 -0400 From: Jim Parker To: Gary Knopp Cc: pgsql-interfaces@postgresql.org Subject: Re: ecpg help Message-ID: <20020927085424.I334@shamrock.cfl.rr.com\000> References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit In-Reply-To: ; from gknopp@netezza.com on Wed, Sep 25, 2002 at 12:58:55 -0400 X-Mailer: Balsa 1.2.4 Lines: 135 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/97 X-Sequence-Number: 3158 The only thing that catches my eye, is the lack of the statement exec sql include sqlca with the include files. I forget the exact reason, but it is needed for the ECPG preprocessor. hope this helps. cheers, Jim Parker On 2002.09.25 12:58 Gary Knopp wrote: > Hello, > I'm running Postgresql 7.2.2 on RedHat Linux 7.1. I am trying to > use > Postgres embedded sql > preprocessor (ECPG). However, I get a loading shared library > problem when I attempt to > execute a program. I included a simple example below... > > Thanks > > Error: > ============ > try: error while loading shared libraries: libecpg.so.3: cannot load > shared > object file: No such file or directory > > echo $LD_LIBRARY_PATH > ====================== > :/home/smith/lib:/usr/local/pgsql/lib:/usr/lib/qt/lib > > ls -l /usr/localpgsql/lib > -rw-r--r-- 1 root root 46302 Aug 30 11:05 libecpg.a > lrwxrwxrwx 1 root root 16 Aug 30 11:05 libecpg.so -> > libecpg.so.3.3.0 > lrwxrwxrwx 1 root root 16 Aug 30 11:05 libecpg.so.3 > -> > libecpg.so.3.3.0 > -rwxr-xr-x 1 root root 40220 Aug 30 11:05 > libecpg.so.3.3.0 > -rw-r--r-- 1 root root 6664 Aug 30 11:05 libpgeasy.a > lrwxrwxrwx 1 root root 16 Aug 30 11:05 libpgeasy.so > -> > libpgeasy.so.2.2 > lrwxrwxrwx 1 root root 16 Aug 30 11:05 libpgeasy.so.2 > -> > libpgeasy.so.2.2 > -rwxr-xr-x 1 root root 10809 Aug 30 11:05 > libpgeasy.so.2.2 > -rw-r--r-- 1 root root 30574 Aug 30 11:05 libpgtcl.a > lrwxrwxrwx 1 root root 15 Aug 30 11:05 libpgtcl.so -> > libpgtcl.so.2.2 > lrwxrwxrwx 1 root root 15 Aug 30 11:05 libpgtcl.so.2 > -> > libpgtcl.so.2.2 > -rwxr-xr-x 1 root root 35241 Aug 30 11:05 > libpgtcl.so.2.2 > -rw-r--r-- 1 root root 82598 Aug 30 11:05 libpq.a > -rw-r--r-- 1 root root 68982 Aug 30 11:05 libpq++.a > lrwxrwxrwx 1 root root 12 Aug 30 11:05 libpq.so -> > libpq.so.2.2 > lrwxrwxrwx 1 root root 14 Aug 30 11:05 libpq++.so -> > libpq++.so.4.0 > lrwxrwxrwx 1 root root 12 Aug 30 11:05 libpq.so.2 -> > libpq.so.2.2 > -rwxr-xr-x 1 root root 74685 Aug 30 11:05 libpq.so.2.2 > lrwxrwxrwx 1 root root 14 Aug 30 11:05 libpq++.so.4 > -> > libpq++.so.4.0 > -rwxr-xr-x 1 root root 47166 Aug 30 11:05 libpq++.so.4.0 > -rwxr-xr-x 1 root root 1041877 Aug 30 11:05 plperl.so > -rwxr-xr-x 1 root root 90075 Aug 30 11:05 plpgsql.so > -rwxr-xr-x 1 root root 540450 Aug 30 11:05 plpython.so > -rwxr-xr-x 1 root root 33726 Aug 30 11:05 pltcl.so > > > > > ##################### try.pc ######################### > #include > > EXEC SQL BEGIN DECLARE SECTION; > int result; > EXEC SQL END DECLARE SECTION; > > int main() > { > EXEC SQL CONNECT TO TmDB; > EXEC SQL SELECT (1+1) INTO :result; > > printf("Result = %d\n",result); > > return 0; > > } > > ##################### Makefile####################### > EC = ecpg > CC = gcc > INCPG = /usr/local/pgsql/include # Path for postgresql includes. > > #Declaration header. > LIBPG = /usr/local/pgsql/lib # Path for ecpg libraries. > LIBSPG = -lecpg -lpq # Ecpg libraries. > CFLAGS = -Wall -g -c > > > %.c: %.pc > $(EC) -t -o $@ $< > > %.o: %.c > $(CC) $(CFLAGS) -I $(INCPG) -o $@ $< > > all: try > > > try: try.o > $(CC) -o $@ $^ -L $(LIBPG) $(LIBSPG) > > clean: > -rm -f *.o core > > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html >