[linux-audio-dev] producing a self-contained executable

Tom Szilagyi tszilagyi at users.sourceforge.net
Fri Apr 29 10:38:24 UTC 2005


Hi,

I'm asking for a bit of help from someone having experience with the
'dirtier' side of Linux programming. :) My problem is that I need to
present a single executable of my software that will run on as many
systems as possible, without trouble caused by non-matching dynamic
library versions. The software is a specialized medical application
for hearing therapy of autist persons, to be distributed among a small
(but heterogenous) client base.

The current state is this: I compile the program, it runs on my
system, but it generates relocation errors and the like if I copy the
executable to another system with a different libc (or other library)
version. This is what I would expect anyway, so no surprise at all.

My first thought was that I should try to produce a statically
compiled executable that contains each and every library it depends
on, so it barely needs any pre-defined resources on the target system.
Executable size and startup time is not an issue here, it just needs
to run everywhere. Producing different executables for different
machines is not an option. Changing these conditions is beyond my
authority.

I've run into difficulties trying to compile a statically linked
version due to problems with GTK, which apparently doesn't allow me to
statically link to it. I also don't really know how to get at
statically linking libc (however I didn't try very hard anyway, since
I already got stuck with GTK).

The app uses GTK, lots of audio file format libraries, ALSA, JACK and
of course libc.

Any help (including pointers to howto-s about statically linking)
would be very welcome.


Tom



More information about the Linux-audio-dev mailing list