[XForms] Statically linked application

Jens Thoms Toerring jt at toerring.de
Fri Oct 6 06:56:25 EDT 2006


On Fri, Oct 06, 2006 at 10:36:08AM +0200, Gerald Emig wrote:
> is there any information available on how to create
> a statically linked XForms program ?

Since, as far as I can see, there's a static as well as a dynamic
version of the XForms library installed per default you should
mostly only need to use the appropriate compiler/linker flags to
create a static program. E.g. for gcc you would need the option
'-static'. But, of course, you also need static library versions
of all other libraries involved to be installed on your system.
On mine (Linux) all required libraries (libm, libpthread, libX11,
libXpm) seem to exist in static versions except glibc, which I
would have to install in order to be able to create a program
without any external dependencies. On the other hand, the linker
just complains a bit about the program still requiring at runtime
the shared version of glib, but the resulting executable seems to
work fine, and perhaps you can live with that since a glibc will
probably exist on all systems you try to run the program on. Other-
wise install a static version of glibc on the system you build the
program on. Just don't be surprised about the size difference, a
small test program that was statically linked - as far as possible,
i.e. still dependent on the shared glic - is over 4 MB while, when
linked without '-static', it's only about 10k....

                                 Regards, Jens
-- 
  \   Jens Thoms Toerring  ________      jt at toerring.de
   \_______________________________      http://www.toerring.de



More information about the Xforms mailing list