Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Depends.exe for GNU/Linux

Tags:

linux

I need to distribute a binary file for GNU/Linux...

On Windows, I could run a utility named "depends.exe" that would verify all dependencies that the file have, thus I would be able to know what to ship with the file, how I do the same with GNU/Linux?

Clarification: I did not mean LITERALLY distributing it (unless it is some certain library that never generate problems, like... libThatOnlyMySoftwareUseVersion0.00042895.08421thatnoonehas Kinda like figuring that the users would need...)

like image 786
speeder Avatar asked Jul 27 '10 01:07

speeder


2 Answers

The utility you are looking for on Linux is called ldd. However, do your users a favor and don't think about distributing libraries with your program. Require your users to install the prerequisites through the proper channels. Or, better yet, package your software using an appropriate installation system like RPM, apt, or portage (I'm assuming you can't use source distribution and the autotools); doing so allows the package management system to automatically resolve dependencies by pulling in any required libraries.

Distributing versions of libraries using ad-hoc schemes is going to only cause problems for end users (something akin to DLL hell on Windows). They can end up with conflicts, crashes, and possibly security holes.

You can use ldd to figure out what libraries your binary depends on so that you can set up the proper dependencies when you make your packages (some packagers, like RPM, actually do this for you).

like image 59
Dan Moulding Avatar answered Sep 30 '22 18:09

Dan Moulding


On linux you can try ldd.

like image 43
ghostdog74 Avatar answered Sep 30 '22 16:09

ghostdog74