pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ecpg help
4+ messages / 3 participants
[nested] [flat]

* ecpg help
@ 2002-09-25 16:58  Gary Knopp <gknopp@netezza.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Gary Knopp @ 2002-09-25 16:58 UTC (permalink / raw)
  To: pgsql-interfaces

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 <stdio.h>

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






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: ecpg help
@ 2002-09-27 12:54  Jim Parker <hopeye@cfl.rr.com>
  parent: Gary Knopp <gknopp@netezza.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Jim Parker @ 2002-09-27 12:54 UTC (permalink / raw)
  To: Gary Knopp <gknopp@netezza.com>; +Cc: pgsql-interfaces

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 <stdio.h>
> 
> 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
> 



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: ecpg help
@ 2002-09-29 08:47  Michael Meskes <meskes@postgresql.org>
  parent: Gary Knopp <gknopp@netezza.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Michael Meskes @ 2002-09-29 08:47 UTC (permalink / raw)
  To: Gary Knopp <gknopp@netezza.com>; +Cc: pgsql-interfaces

On Wed, Sep 25, 2002 at 12:58:55PM -0400, Gary Knopp wrote:
>  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...
> ...

> :/home/smith/lib:/usr/local/pgsql/lib:/usr/lib/qt/lib
> 
> ls -l /usr/localpgsql/lib
                  
I take it the missing "/" is a typo here, but something like this is
probably the reason. Your problem is on OS level and nothing to do with
ecpg itself. I'd try running ldd to find out more.

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: ecpg help
@ 2002-09-29 08:49  Michael Meskes <meskes@postgresql.org>
  parent: Jim Parker <hopeye@cfl.rr.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Meskes @ 2002-09-29 08:49 UTC (permalink / raw)
  To: Jim Parker <hopeye@cfl.rr.com>; +Cc: Gary Knopp <gknopp@netezza.com>; pgsql-interfaces

On Fri, Sep 27, 2002 at 08:54:24AM -0400, Jim Parker wrote:
> 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.

No, not anymore. Nowadays ecpg does include it automatically.

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-09-29 08:49 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-25 16:58 ecpg help Gary Knopp <gknopp@netezza.com>
2002-09-27 12:54 ` Jim Parker <hopeye@cfl.rr.com>
2002-09-29 08:49   ` Michael Meskes <meskes@postgresql.org>
2002-09-29 08:47 ` Michael Meskes <meskes@postgresql.org>

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