Jean-Marc Sac-Epee on Tue, 15 Apr 2008 16:19:54 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: error while loading shared libraries

Bill Allombert a écrit :
On Mon, Apr 14, 2008 at 06:06:00PM +0200, Jean-Marc Sac-Epee wrote:
Hello !

Always using gp-pari in gp-mode, I now need to use it in library mode.

With a simple C program premier.c and the classical Makefile :

[jm@localhost Pari]$ make
cc -O -I/usr/local/include/pari -L/usr/local/lib -o premier premier.c -lpari -lm
[jm@localhost Pari]$

But after that, I get :

[jm@localhost Pari]$ ./premier
./premier: error while loading shared libraries: cannot open shared object file: No such file or directory

Well, I installed Pari with ./Configure --> make --> make install and all seemed OK.

This is a problem with the dynamic loader: maybe it does not search
/usr/local/lib by default.

You can use 'ldd ./premier' to check the dynamic loader behaviour.

You can add /usr/local/lib to the dynamic loader search path by
issuing export LD_LIBRARY_PATH=/usr/local/lib
(or setenv LD_LIBRARY_PATH /usr/local/lib if you use tcsh)
Thank you very much, Bill, you're right :

[jm@localhost Pari]$ ldd ./premier =>  (0xffffe000) => not found => /lib/i686/ (0xb7f60000) => /lib/i686/ (0xb7e20000)
       /lib/ (0xb7f9f000)

So, I just add your line export LD_LIBRARY_PATH=/usr/local/lib in my .bash_profile and now, all is OK.

Thank you !


Jean-Marc Sac-Epée, Ingénieur de Recherches en Calcul Scientifique,
Laboratoire de Mathématiques, UMR 7122, Université de Metz,
Tél 03 87 54 72 69  Fax 03 87 31 52 73   mail: