Jahan Balasubramaniam
Jahan Balasubramaniam

Reputation: 360

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

Upvotes: 0

Views: 1648

Answers (3)

ikaro
ikaro

Reputation: 741

I tip that it works for me (after adding all dependencies with ldd) is to install a fresh linux in virtualBox and try the distribution tar as I'd be the final user. That way you can check that everything is ok.

Upvotes: 1

Validus Oculus
Validus Oculus

Reputation: 2701

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

Upvotes: 1

Jesper Juhl
Jesper Juhl

Reputation: 31459

The ldd command can be used to show what libraries an executable (or library) is linked to.

Upvotes: 1

Related Questions