[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] Xforms & threads-functions & others, Sergey Klimkin <addres

From: Jens Thoms Toerring
Subject: Re: [XForms] Xforms & threads-functions & others, Sergey Klimkin <address@hidden>
Date: Tue, 11 Oct 2011 21:51:43 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Sergey,

  just found some better way to do it:

$(CC) survey_main.o survey.o survey_cb.o -o $(OUTPUT) -Wl,-Bstatic -lforms 
-lXpm -Wl,-Bdynamic -lpthread -lm -lX11

This will link statically against the XForms and the Xpm li-
braries (which have a certain chance of not being available
on your friends computer) while linking dynamically against
the math, X11 and threads library (I would be astonished if
those would also be missing).

The '-Wl' option starts a command directly addressed to the
linker and '-Wl,-Bstatic' tells the linker to switch to static
and the following '-Wl,-Bdynamic' back to dynamic linking. As
a rule, statically linked libraries should come first.

Note that when linking dyamically against the XForms library
you don't have to link explicitely against the Xpm, math or
X11 libraries - they get included automatically. But that bit
of "magic" doesn't work anymore when linking statically, so
you have to link against them explicitely.

Sorry but's been years since I used static linking so my me-
mories of how it's done properly have become a bit hazy...

                            Regards, Jens
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]