LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   libtermcap.so.2: cannot open shared object file: No such file or directory (https://www.linuxquestions.org/questions/linux-software-2/libtermcap-so-2-cannot-open-shared-object-file-no-such-file-or-directory-216721/)

tcma 08-12-2004 11:19 AM

libtermcap.so.2: cannot open shared object file: No such file or directory
 
Running a program get this error.

# ch
ch: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory

However, libtermcap.so.2 is present.
# ls -l /lib/libtermcap*
lrwxrwxrwx 1 root root 19 Aug 12 10:03 /lib/libtermcap.so -> libtermcap.so.2.0.8
lrwxrwxrwx 1 root root 19 Aug 4 13:48 /lib/libtermcap.so.2 -> libtermcap.so.2.0.8
-rwxr-xr-x 1 root root 15320 Aug 12 10:03 /lib/libtermcap.so.2.0.8

I tried linking libtermcap.so.2 with libncurses.so.5, but still
doesn't work.

Linux version 2.6.7-gentoo-r11 (root@rose) (gcc version 3.4.1 (Gentoo
Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3)) amd64

qwijibow 08-12-2004 11:45 AM

use ldd to make sure the program is not looking for the library in the wrong place.
if it is looking in the wrong place, add a symbolic link to fix it.

tcma 08-12-2004 01:10 PM

ldd /bin/ch
libtermcap.so.2 => not found
libm.so.6 => /lib32/libm.so.6 (0x5557c000)
libc.so.6 => /lib32/libc.so.6 (0x5559d000)
libdl.so.2 => /lib32/libdl.so.2 (0x556b4000)
libcrypt.so.1 => /lib32/libcrypt.so.1 (0x556b8000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x55555000)

libtermcap.so.2 is in the same /lib directory as /ld-linux.so.2.
Why ld-linux.so.2 is found but not libtermcap.so.2?

Quote:

Originally posted by qwijibow
use ldd to make sure the program is not looking for the library in the wrong place.
if it is looking in the wrong place, add a symbolic link to fix it.


qwijibow 08-13-2004 05:50 AM

hmm.... okay, time to go overkill....

strace -o error.log /path/to/ch
cat error.log | grep libtermcap.so.2

this will print a list of actual paths,
its notmal to see lots of attempted opens but atleast one should be in the right place.
again, if non of the atempts are in the right place, fix with a symbolic link.

as for ldconfig, i may be wrong, but i think ldconfig is only used to locate library's when you are compiling from source, im assuning you installed this program from a binary rpm or somthing similar.

Mara 08-13-2004 05:18 PM

Moved: This thread is more suitable in Linux-Software and has been moved accordingly to help your thread/question get the exposure it deserves.

tcma 08-13-2004 07:05 PM

# strace -o error.log /bin/ch
[ Process PID=11358 runs in 32 bit mode. ]
/bin/ch: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory

# cat error.log
execve("/bin/ch", ["/bin/ch"], [/* 41 vars */]) = 0


My linux is 64bit AMD64 gentoo.
It seems that /bin/ch is running in 32 bit mode.
How to fix this probem?

[QUOTE]Originally posted by qwijibow
[B]

strace -o error.log /path/to/ch
cat error.log | grep libtermcap.so.2

qwijibow 08-14-2004 04:38 PM

i have no experiance with 64 bit processors.

did you install this program via binary rpm or some other format ?
compile it yourself.

impala454 12-02-2009 02:50 PM

Hello, I know this is an ancient thread, but it came up in a google search and I wanted to let qwijibow know that his ldd suggestion helped me big time. I have been looking for some kind of utility like that and didn't realize it was standard. Thanks!

ahamed101 02-15-2011 03:07 AM

strace helped
 
Hi, I also know this is a very old thread. But just wanted to thank you for the strace command which helped in solving my issue.

In my case, the executable was checking for the library in the /usr/lib where as the private libraries were in a different path. Right now I created a link in /usr/lib to check if its working.

The path where the libraries are present is present in the LD_LIBRARY_PATH, dont know why its not taking it. :(

Anyways, thank you guys. :)

regards,
Ahamed.

leamassiot 10-29-2011 11:33 AM

I agree with @impala454 and @ahamed101:
these two commands "ldd" and "strace" are really useful!
Thank you @qwijibow!

I did something like:
Code:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/some/lib/directory/containing/the/so/file
I re-ran the program and it worked.

Best regards,
--
Léa

ff76 02-23-2012 10:56 AM

thanks!
 
i just signed up to say that your tips have not aged.
they have resolved my problem as well.

Thanks @leamassiot @qwijibow!

leamassiot 02-24-2012 03:00 AM

It's good to know @ff76 :) Thank you.


All times are GMT -5. The time now is 03:16 AM.