Thread: PSQL NEWBIE - RUNTIME ERROR

PSQL NEWBIE - RUNTIME ERROR

From
"FTL Africa"
Date:

Hello,

I am a fairly new user of postgresql on linux. I have followed the instruction quite well, I’m sure. I have been working on the first program example in C and am getting an error when I run the first program test "testlibpq.c" (I haven’t tried the other tests). This is the error msg I am getting:

./testlibpq:error in loading shared libraries

libpq.so.2: cannot open shared object file: No such file or directory.

These are the version I am working with:

postgreSQL : 7.2.1

linux : 2.0.32

gcc : 2.7.2.3

I compiled using:

cc –c –I/usr/local/pgsql/include testlibpq.c

linked with:

cc –0 testlibpq testlibpq.0 –L/usr/local/psql/lib –lpq

ran with:

./testlibpq

Any help will be highly appreciated. I am stuck at this point right now.

Thanks In Advance,

Litso

Re: PSQL NEWBIE - RUNTIME ERROR

From
Martijn van Oosterhout
Date:
If you link to a library on your system that is not in your library path,
you will get this problem.

The solutions is basically one of:
- Create a symlink to the lib in a directory that is in the path (like
/usr/local/lib)
- Add the directory to your /etc/ld.so.conf
- Add it to your LD_LIBRARY_PATH environment variable

Rerun ldconfig  in any case.

Hope this helps.

On Fri, Jun 27, 2003 at 05:07:53PM +0200, FTL Africa wrote:
> Hello,
>
> I am a fairly new user of postgresql on linux. I have followed the instruction quite well, I'm sure. I have been
workingon the first program example in C and am getting an error when I run the first program test "testlibpq.c" (I
haven'ttried the other tests). This is the error msg I am getting: 
>
> ./testlibpq:error in loading shared libraries
>
> libpq.so.2: cannot open shared object file: No such file or directory.
>
> These are the version I am working with:
>
> postgreSQL : 7.2.1
>
> linux : 2.0.32
>
> gcc : 2.7.2.3
>
> I compiled using:
>
> cc -c -I/usr/local/pgsql/include testlibpq.c
>
> linked with:
>
> cc -0 testlibpq testlibpq.0 -L/usr/local/psql/lib -lpq
>
> ran with:
>
> ./testlibpq
>
> Any help will be highly appreciated. I am stuck at this point right now.
>
> Thanks In Advance,
>
> Litso
>

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington

Attachment

Re: PSQL NEWBIE - RUNTIME ERROR

From
Chris Albertson
Date:
Assuming the standard install to /usr/local/pgsql
you need to add /usr/local/pgsql/lib to the linker's
search path and (if Linux) run ldconfig

> > ./testlibpq:error in loading shared libraries
> >
> > libpq.so.2: cannot open shared object file: No such file or
> directory.


=====
Chris Albertson
  Home:   310-376-1029  chrisalbertson90278@yahoo.com
  Cell:   310-990-7550
  Office: 310-336-5189  Christopher.J.Albertson@aero.org
  KG6OMK

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com