You are not logged in.

#1 2012-08-16 21:36:59

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

library file exists but program can't find it

I've installed the libitl package from AUR.  Trying to use it---i.e., calling the library from a program---is giving me trouble.

My program compiles just fine, with these commands:

gcc -c -g -Wall -I/usr/include/itl -L/usr/lib/itl -litl  main.c -o main.o
gcc -L/usr/lib/itl -I/usr/include/itl -litl main.o

But when I attempt to run the program "./a.out", I get:

./a.out: error while loading shared libraries: libitl.so.0: cannot open shared object file: No such file or directory

I get the same error if I run "LD_LIBRARY_PATH=/usr/lib/itl ./a.out".

I've also tried ldconfig:

$ sudo ldconfig -v | grep libitl
ldconfig: Path `/lib64' given more than once
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Can't stat /usr/lib64: No such file or directory
ldconfig: Can't stat /usr/libx32: No such file or directory

However, libitl.so.0 exists quite plainly in /usr/lib/itl, a symlink to /usr/lib/itl/libitl.so.0.0.7.

What am I missing?

Offline

#2 2012-08-21 22:07:07

Techmeology
Member
Registered: 2012-08-21
Posts: 19

Re: library file exists but program can't find it

I've seen a message fairly similar to this quite deceptively when the file exists but for whatever reason the executable is bad.

Try compiling with:

gcc -c -g -Wall -I/usr/include/itl  main.c -o main.o
gcc -L/usr/lib/itl -I/usr/include/itl -litl -o some_name main.o

(I'm probably just being slightly paranoid adding -o some_name)

If that still doesn't work, please paste the outputs from

objdump -rf /usr/lib/itl
objdump -rf some_program

Offline

Board footer

Powered by FluxBB