M
M
Maxim2011-12-31 19:53:29
QNX
Maxim, 2011-12-31 19:53:29

How to find program dependencies in *nix?

There are sources of a program that needs to be compiled in QNX 6.5. So how do you know the dependency tree for it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eol, 2011-12-31
@syler

I don't know how true this is for QNX, but in general, as a rule, sources are supplied with scripts for the build system (CMake, automake/autotools, qmake, ...). Then the dependencies can be found in the files corresponding to these build systems (CMakeLists.txt, configure, Makefile.in, Makefile.am, *.pro, ...).
Sometimes sources are supplied with a README/INSTALL file, which may contain the necessary information.
If all this is not there, then I can’t think of anything better than just looking at the source codes, include’s and using them to google which libraries they correspond to.

V
Vlad Zhivotnev, 2011-12-31
@inkvizitor68sl

Posobirat and see what will ask. Usually, in the dependencies of simple programs, only libraries.

P
phasma, 2011-01-01
@phasma

ldd

Z
zuborg, 2012-01-02
@zuborg

# grep -Rh '#include'. | sort | uniq -c | sort -n
All libraries require corresponding #include lines to import functions, constants, macros, etc. from the library.
Finding out where to put the corresponding .h file depends on the OS, whereis or locate may help. Well, or google.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question