Fully Static linking problem

Johan Maes on1mh at pandora.be
Sun Jul 8 12:46:05 BST 2001


Hi Walter,

Where do I specify the option -all-static.
If I put it in the project options/additional linker options, then Jdevelop 
will rerun configure and the configure fails with unknown g++ option.

regards
johan


On Sunday 08 July 2001 12:25, W. Tasin wrote:
> Hi,
>
> Johan Maes wrote:
> >Hi,
> >I have the following problem:
> >
> >KDevelop 1.4 , Suse 7.0
> >
> >Goal: make an exec that is fully statically linked.
> >
> >1) I create a C++ project (no kde , no qt)
> >2) I add -static to the linker option.
> >3) I compile/link the program.
>
> your goal will be reached by using switch -all-static instead of
> -static, because -static is now caught by libtool and has a different
> meaning.
>
> -static means all libtool libraries will be linked statically
> (only if possible... if a used libtool library doesn't exist in static
> version, the build process falls back to link the respective library in
> shared version)
>
> -all-static instead forces the build process to link all libraries
> statically
> (if a used library doesn't exist in static version the build process
> fails or hangs *sigh*)
>
> BTW:
> Calling "libtool -help" and/or "libtool -help -mode=link" shows you the
> features of your libtool script.
>
> >4) KDevelop uses .libtool script (why ???) , but makes a standard
> > executable. (you see that it dropped -static in the g++ ... line)
>
> Answering point 4):
> that's right, libtool script is used... why not?
>
> Libtool is a shell to cover compiler/linker calls to handle (almost) all
> situations of project's build and run and debug process, which use
> project-libs and/or published libs.
>
> Ciao
>
> Walter
>
> >Message output:
> >gmake  all-recursive
> >gmake[1]: Entering directory `/projects/test'
> >Making all in test
> >gmake[2]: Entering directory `/projects/test/test'
> >Making all in docs
> >gmake[3]: Entering directory `/projects/test/test/docs'
> >Making all in en
> >gmake[4]: Entering directory `/projects/test/test/docs/en'
> >gmake[4]: Nothing to be done for `all'.
> >gmake[4]: Leaving directory `/projects/test/test/docs/en'
> >gmake[4]: Entering directory `/projects/test/test/docs'
> >gmake[4]: Nothing to be done for `all-am'.
> >gmake[4]: Leaving directory `/projects/test/test/docs'
> >gmake[3]: Leaving directory `/projects/test/test/docs'
> >gmake[3]: Entering directory `/projects/test/test'
> >g++ -DHAVE_CONFIG_H -I. -I. -I..     -O0 -Wall -W
> >-Wtraditional-Wpointer-arith    -c main.cpp
> >bin/sh ../libtool --mode=link g++  -O0 -Wall -W -Wtraditional
> > -Wpointer-arith -static  -o test   main.o
> >g++ -O0 -Wall -W -Wtraditional -Wpo
> >inter-arith -o test main.o
> >gmake[3]: Leaving directory `/projects/test/test'
> >gmake[2]: Leaving directory `/projects/test/test'
> >gmake[2]: Entering directory `/projects/test'
> >gmake[2]: Leaving directory `/projects/test'
> >gmake[1]: Leaving directory `/projects/test'
> >*** success ***
> >
> >
> >-
> >to unsubscribe from this list send an email to
> > kdevelop-request at kdevelop.org <mailto:kdevelop-request at kdevelop.org> with
> > the following body: unsubscribe »your-email-address«

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list