LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2004, 11:19 AM   #1
tcma
Member
 
Registered: Aug 2004
Distribution: gentoo, Fedora Core
Posts: 54

Rep: Reputation: 15
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
 
Old 08-12-2004, 11:45 AM   #2
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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.
 
1 members found this post helpful.
Old 08-12-2004, 01:10 PM   #3
tcma
Member
 
Registered: Aug 2004
Distribution: gentoo, Fedora Core
Posts: 54

Original Poster
Rep: Reputation: 15
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.
 
Old 08-13-2004, 05:50 AM   #4
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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.
 
1 members found this post helpful.
Old 08-13-2004, 05:18 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Moved: This thread is more suitable in Linux-Software and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 08-13-2004, 07:05 PM   #6
tcma
Member
 
Registered: Aug 2004
Distribution: gentoo, Fedora Core
Posts: 54

Original Poster
Rep: Reputation: 15
# 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

Last edited by tcma; 08-14-2004 at 11:01 AM.
 
Old 08-14-2004, 04:38 PM   #7
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
i have no experiance with 64 bit processors.

did you install this program via binary rpm or some other format ?
compile it yourself.
 
Old 12-02-2009, 02:50 PM   #8
impala454
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
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!
 
Old 02-15-2011, 03:07 AM   #9
ahamed101
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Rep: Reputation: 1
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.
 
1 members found this post helpful.
Old 10-29-2011, 11:33 AM   #10
leamassiot
Member
 
Registered: Dec 2005
Location: France
Distribution: Debian
Posts: 123

Rep: Reputation: 17
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

Last edited by leamassiot; 10-29-2011 at 11:42 AM.
 
1 members found this post helpful.
Old 02-23-2012, 10:56 AM   #11
ff76
LQ Newbie
 
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
thanks!

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

Thanks @leamassiot @qwijibow!
 
Old 02-24-2012, 03:00 AM   #12
leamassiot
Member
 
Registered: Dec 2005
Location: France
Distribution: Debian
Posts: 123

Rep: Reputation: 17
It's good to know @ff76 Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: Franziss Linux - Newbie 10 06-28-2010 05:47 AM
cannot open shared object file barells Linux - Software 2 07-16-2005 07:53 AM
error while loading shared libraries: libdb-4.1.so: cannot open shared object file putquery8581 Linux - Software 1 10-01-2004 07:03 AM
libawt.so: libXp.so.6: cannot open shared object file: No such file or directory man26 *BSD 0 09-10-2004 08:34 AM
libtermcap.so.2: cannot open shared object file tcma Linux - General 1 08-12-2004 09:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration