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

* libpq.so.3 not found
@ 2003-09-08 23:52  Xinyu Hua <xhua@cse.ucsc.edu>
  0 siblings, 1 reply; 8+ messages in thread

From: Xinyu Hua @ 2003-09-08 23:52 UTC (permalink / raw)
  To: pgsql-interfaces

Hi,all
I am working on solaris platform.
When I try to create an executable file using gcc -o -L -lpq, it gives me
an error message:
ld.so.1: file_name: fatal: libpq.so.3: open failed: No such file or
directory
But I give the full path of lib files in -L option. And libpq.so.3 is
right there.
Can anyone help me?
Thanks a lot.
Xinyu




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

* Re: libpq.so.3 not found
@ 2003-09-09 00:06  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Xinyu Hua <xhua@cse.ucsc.edu>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2003-09-09 00:06 UTC (permalink / raw)
  To: Xinyu Hua <xhua@cse.ucsc.edu>; +Cc: pgsql-interfaces

Xinyu Hua <xhua@cse.ucsc.edu> writes:
> I am working on solaris platform.
> When I try to create an executable file using gcc -o -L -lpq, it gives me
> an error message:
> ld.so.1: file_name: fatal: libpq.so.3: open failed: No such file or
> directory
> But I give the full path of lib files in -L option. And libpq.so.3 is
> right there.

Dynamic linker error messages are notoriously unhelpful :-(.  I'll bet
it's really complaining about not being able to find some library that
libpq.so depends on.  You should be able to use ldd (or local equivalent)
to inspect the list of libraries that libpq.so needs, and from there
figure out what the problem is.

			regards, tom lane



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

* Re: libpq.so.3 not found
@ 2003-09-09 03:37  Xinyu Hua <xhua@cse.ucsc.edu>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: Xinyu Hua @ 2003-09-09 03:37 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces



On Mon, 8 Sep 2003, Tom Lane wrote:

> Xinyu Hua <xhua@cse.ucsc.edu> writes:
> > I am working on solaris platform.
> > When I try to create an executable file using gcc -o -L -lpq, it gives me
> > an error message:
> > ld.so.1: file_name: fatal: libpq.so.3: open failed: No such file or
> > directory
> > But I give the full path of lib files in -L option. And libpq.so.3 is
> > right there.
>
> Dynamic linker error messages are notoriously unhelpful :-(.  I'll bet
> it's really complaining about not being able to find some library that
> libpq.so depends on.  You should be able to use ldd (or local equivalent)
> to inspect the list of libraries that libpq.so needs, and from there
> figure out what the problem is.

Tom, I think all the libraries that libpq.so needs are right there. Please
see the following:
 libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
sundance 50> ls /usr/lib/libsocket.so.1
/usr/lib/libsocket.so.1*
sundance 51> ls /usr/lib/libnsl.so.1
/usr/lib/libnsl.so.1*
sundance 52> ls /usr/local/lib/libgcc_s.so.1
/usr/local/lib/libgcc_s.so.1
sundance 53> ls /usr/lib/libc.so.1
/usr/lib/libc.so.1*
sundance 54> ls /usr/lib/libdl.so.1
/usr/lib/libdl.so.1*
sundance 55> ls /usr/lib/libmp.so.2
/usr/lib/libmp.so.2*
sundance 56> ls /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1@

So what else could be wrong?
Thank you very much.
Xinyu




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

* Re: libpq.so.3 not found
@ 2003-09-09 03:41  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Xinyu Hua <xhua@cse.ucsc.edu>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2003-09-09 03:41 UTC (permalink / raw)
  To: Xinyu Hua <xhua@cse.ucsc.edu>; +Cc: pgsql-interfaces

Xinyu Hua <xhua@cse.ucsc.edu> writes:
> Tom, I think all the libraries that libpq.so needs are right there. Please
> see the following:
>  libresolv.so.2 =>        /usr/lib/libresolv.so.2
>         libsocket.so.1 =>        /usr/lib/libsocket.so.1
>         libnsl.so.1 =>   /usr/lib/libnsl.so.1
>         libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1

Almost certainly, the problem is that /usr/local/lib/ isn't getting
searched and so libgcc_s.so isn't found.  This sort of problem is easily
hit because different bits of code have different ideas about where to
search for shared libraries.  I think ldd pays attention to
LD_LIBRARY_PATH, but gcc only pays attention to -L switches.

			regards, tom lane



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

* Re: libpq.so.3 not found
@ 2003-09-09 03:52  Xinyu Hua <xhua@cse.ucsc.edu>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: Xinyu Hua @ 2003-09-09 03:52 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces



On Mon, 8 Sep 2003, Tom Lane wrote:

> Xinyu Hua <xhua@cse.ucsc.edu> writes:
> > Tom, I think all the libraries that libpq.so needs are right there. Please
> > see the following:
> >  libresolv.so.2 =>        /usr/lib/libresolv.so.2
> >         libsocket.so.1 =>        /usr/lib/libsocket.so.1
> >         libnsl.so.1 =>   /usr/lib/libnsl.so.1
> >         libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
>
> Almost certainly, the problem is that /usr/local/lib/ isn't getting
> searched and so libgcc_s.so isn't found.  This sort of problem is easily
> hit because different bits of code have different ideas about where to
> search for shared libraries.  I think ldd pays attention to
> LD_LIBRARY_PATH, but gcc only pays attention to -L switches.
>
Tom, how can i fix that? I specified -L/usr/local/lib, but it does not
work. Thank you so much.
Xinyu




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

* Re: libpq.so.3 not found
@ 2003-09-09 03:55  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Xinyu Hua <xhua@cse.ucsc.edu>
  0 siblings, 2 replies; 8+ messages in thread

From: Tom Lane @ 2003-09-09 03:55 UTC (permalink / raw)
  To: Xinyu Hua <xhua@cse.ucsc.edu>; +Cc: pgsql-interfaces

Xinyu Hua <xhua@cse.ucsc.edu> writes:
> Tom, how can i fix that? I specified -L/usr/local/lib, but it does not
> work. Thank you so much.

In that case I'm out of ideas :-(.  Anyone else care to take a swing?

			regards, tom lane



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

* Re: libpq.so.3 not found
@ 2003-09-09 09:22  Nigel J. Andrews <nandrews@investsystems.co.uk>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 8+ messages in thread

From: Nigel J. Andrews @ 2003-09-09 09:22 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Xinyu Hua <xhua@cse.ucsc.edu>; pgsql-interfaces

On Mon, 8 Sep 2003, Tom Lane wrote:

> Xinyu Hua <xhua@cse.ucsc.edu> writes:
> > Tom, how can i fix that? I specified -L/usr/local/lib, but it does not
> > work. Thank you so much.
> 
> In that case I'm out of ideas :-(.  Anyone else care to take a swing?
> 
k
Try adding the -v switch to gcc just to verify that the commands look
sensible. Isn't there also something that makes the indiviudal stages like ld
more verbose?

Could it be that in the linking stage it's picking up the wrong ld and that's
somehow not looking in the same locations?

--
Nigel Andrews





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

* Re: libpq.so.3 not found
@ 2003-09-09 23:56  Philip Yarra <philip@utiba.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 8+ messages in thread

From: Philip Yarra @ 2003-09-09 23:56 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Xinyu Hua <xhua@cse.ucsc.edu>; +Cc: pgsql-interfaces

On Tue, 9 Sep 2003 01:55 pm, Tom Lane wrote:
> In that case I'm out of ideas :-(.  Anyone else care to take a swing?

I'm game - I hit a similar problem on my old Sparc box last night (not related 
to libpq specifically). I did this:

$ uname -a
SunOS sparc4 5.6 Generic_105181-05 sun4m sparc SUNW,SPARCstation-4
$ gcc -lpthread test.c # this is Bruce's thread test app
Undefined                       first referenced
 symbol                             in file
gethostbyname                       /var/tmp/cc31rpyq.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
$ gcc -lpthread -lnsl test.c # this works

libnsl contains the gethostbyname function... why on earth I had to tell the 
linker to actually link against it, I do not know, especially since I didn't 
need to tell it -L/usr/lib to locate the .so... maybe if you're still stuck, 
try telling it to link against absolutely everything.

Regards, Philip.



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


end of thread, other threads:[~2003-09-09 23:56 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08 23:52 libpq.so.3 not found Xinyu Hua <xhua@cse.ucsc.edu>
2003-09-09 00:06 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-09-09 03:37   ` Xinyu Hua <xhua@cse.ucsc.edu>
2003-09-09 03:41     ` Tom Lane <tgl@sss.pgh.pa.us>
2003-09-09 03:52       ` Xinyu Hua <xhua@cse.ucsc.edu>
2003-09-09 03:55         ` Tom Lane <tgl@sss.pgh.pa.us>
2003-09-09 09:22           ` Nigel J. Andrews <nandrews@investsystems.co.uk>
2003-09-09 23:56           ` Philip Yarra <philip@utiba.com>

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