Peter
Peter

Reputation: 11890

Linux - How to fix shared library links within executable image?

Folks,

I have created a Linux-based executable. I would like to set it up such that users can simply download and use. As long as the users have x86 version of Ubuntu 11.xx, they should simply be able to run the application.

The problem I am trying to figure out is how to deal with shared libraries. For example, my executable may require libxxx.so.23 but the user may have libxxx.so.22. For the functionality that I am using, the application would work with any version of the sofile.

Looking at a similar post, the advice was to create a new symbolic link between the two versions.

The problem is that I cannot expect users to sit and create symbolic links for all the dependencies.

There must be a better way to create a simple executable that is ready for mass distribution. Obviously, packages that are downloaded through apt-get seem to be automatically deal with this problem.

I appreciate your help.

Regards, Peter

Upvotes: 1

Views: 549

Answers (2)

Siva Karuppiah
Siva Karuppiah

Reputation: 1013

I would suggest to create the static build for you application. Link with libxxx.a ( Static library ) while u create the build.

 Or you can create the .deb ( for ubuntu and debian ) package. 
 It will resolve the library  dependencies. 

By SIVA K

Upvotes: 0

zed_0xff
zed_0xff

Reputation: 33217

compile your package statically, so it not depends on any specific .so-file(s)

packages in apt and similar binary-based package managers are usually depend on exact versions of libs, so, for example, nmap-2.2.3 depends on libpcap-1.1.2, so it always links to the same .so.

Upvotes: 2

Related Questions