Search code examples
c++opencvpackaging

C++ Packaging: Finding shared library dependencies


I have build an application in C++ which is linked with 3rd party shared libraries such as opencv. Now I would require to package this application and redistribute as tar files to users, with out having them to install and compile the 3rd party dependencies. Compiling libraries such as opencv in linux/Ubuntu is such a painful process.

Now I will want to find exactly what all specific modules of a library is linked to executable and include them in the distribution tar. I dont want to include the whole library as the size will of the tar will blow up.

Will it be sufficient enough just to include libraries detected by the ldd command? Any guidance or tip-off/starting point would be helpful


Solution

  • By its definition "ldd - print shared object dependencies". Besides, I personally confirm that it works as I always use it in professional projects.

    Also you can check the same question and answers here. https://unix.stackexchange.com/questions/120015/how-to-find-out-the-dynamic-libraries-executables-loads-when-run