LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-22-2005, 06:52 PM   #1
jdupre
Member
 
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 36

Rep: Reputation: 15
How to find executable's dependencies?


Is there a utility that will examine a binary executable to determine what it's dependencies are (i.e external library requirements)?

I have a program that will run on one system, but on another it returns the following:

# ./project2
-sh: ./project2: not found

Does this mean that it can't find a required library? The file "project2" most cirtainly is there, and it is chmod 755 and I am root. (It would be nice if it reported what it couldn't find!)

- Joe
 
Old 11-22-2005, 07:36 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"Is there a utility that will examine a binary executable to determine what it's dependencies are (i.e external library requirements)?"

You can do it with rpm on an rpm based system like Fedora or Red Hat. First you find out what rpm package provides project2. Use the full pathname for project2 in this rpm command:

rpm -q --whatprovides /pathname/project2

Let's assume that rpm replies: utilpkg-1.0.2

Then you can find out what packages utilpkg-1.0.2 is dependent on with:

rpm -q -R utilpkg-1.0.2

----------------------
Steve Stites
 
Old 11-22-2005, 08:01 PM   #3
jdupre
Member
 
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 36

Original Poster
Rep: Reputation: 15
No, this has nothing to do with RPMs. In my example, "project2" is the name of the executable I want to run. It does exist. But when I type
Code:
./project2
what I get in response is:
Code:
-sh: ./project2: not found
This looks like the file "project2" does not exist, but that simply is not the case:
Code:
# ls -l project2
-rwxr-xr-x     1    root    root    242216   Nov 23 2005 project2
#
What I think this means is that the executable itself is looking for a library that does not exist. I'd like to know how to find out what the executable is looking for.

- Joe
 
Old 11-22-2005, 08:26 PM   #4
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
give "ldd" a try

ldd /usr/bin/executable
 
Old 11-23-2005, 05:34 AM   #5
raseel
LQ Newbie
 
Registered: Oct 2005
Distribution: Fedora Core 3
Posts: 20

Rep: Reputation: 0
One more thing you can do is.... you can give the whole path and see.

E.g., if project2 is in /home/raseel :

$/home/raseel/project2 <Enter>
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rpm cannot find installed dependencies guitarfella Slackware 1 02-23-2005 05:24 AM
rpm can't find installed dependencies? jbeiter Linux - General 4 09-17-2004 04:53 PM
Failed dependencies, can't seem to find the right one (mplayer, fc2). brynjarh Linux - Newbie 1 07-08-2004 06:16 PM
Where to find needed Dependencies? l0f33t Linux - Software 13 08-13-2003 10:35 PM
How to get executable's full path using C/C++? oldbee Programming 6 02-19-2002 10:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration