LinuxQuestions.org
Visit Jeremy's Blog.
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 02-22-2008, 06:10 PM   #1
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Rep: Reputation: 31
how to see which libraries a binary program needs


Here is a typical message when a certain dependency is unmet:
Code:
root:# Eterm
Eterm: error while loading shared libraries: libast.so.1: cannot open shared object file: No such file or directory
I recall there was a command that lists all the libraries(and the locations where the binary expects them) that a certain binary needs.
I don't remember the command and the terms I use in Google return everything but what I need.
Thanks in advance.
 
Old 02-22-2008, 06:22 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
I believe you are after 'ldd'.

Code:
 ldd $(which xterm)
 
Old 02-22-2008, 06:35 PM   #3
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by rayfordj View Post
I believe you are after 'ldd'.

Code:
 ldd $(which xterm)
That must be it.
Thanks alot!
 
Old 02-22-2008, 06:36 PM   #4
ComputerGreek
Member
 
Registered: Sep 2007
Posts: 152

Rep: Reputation: 30
You can also try objdump

more explicitly:

objdump -p $executable | grep NEEDED | awk '{print $2}'

This gives you only those libraries needed by the executable.

So, it is more precise.

Last edited by ComputerGreek; 02-22-2008 at 06:39 PM.
 
Old 02-23-2008, 05:22 AM   #5
ComputerGreek
Member
 
Registered: Sep 2007
Posts: 152

Rep: Reputation: 30
By the way: objdump comes in the binutils-2.18.tar.gz package from:

http://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.gz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
NZB Binary program Acknud Linux - Software 1 04-06-2007 07:27 PM
Cross compiling to Windows binary, including Linux shared libraries Siiiiiii Programming 2 03-09-2007 12:36 AM
How can I find out if libraries are hard coded into the binary (QT specificly) drkstr Slackware 8 06-18-2006 08:35 PM
Linking program with .a libraries rudy2 Programming 2 04-22-2005 05:36 AM
How to produce two binary program using automake melinda_sayang Programming 1 06-05-2004 11:30 AM

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

All times are GMT -5. The time now is 02:44 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