[XForms] Statically linked application

Jens Thoms Toerring jt at toerring.de
Fri Oct 6 10:29:09 EDT 2006


On Fri, Oct 06, 2006 at 03:23:43PM +0200, Gerald Emig wrote:
> Todd Denniston <Todd.Denniston at ssa.crane.navy.mil> wrote:
> 
> >  Although I have forgotten how, it is possible to specify how each
> >  individual library should be linked, i.e., it is possible to tell the
> >  compiler link libforms static and libc dynamic, thus you could build
> >  on a box with Xforms and put it on systems that don't have Xforms
> >  installed.
>
> many thanks for the hints. What Todd writes is just what I want to do.

If you just want to link against the static version of the XForms
library but want to use the shared versions of all the other
libraries then just explicitely link against teh staic library
libforms.a, e.g.

gcc -o xformtest xformtest.c /usr/local/lib/libforms.a \
    -L/usr/X11R6/lib -lX11 -lm

(assuming the static version of the XForms library is installed
in /usr/local/lib). Static libaries are just a collection of object
files and when linking you can use them the same way as object files.

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



More information about the Xforms mailing list