Fully Static linking problem
W. Tasin
tasin at fhm.edu
Sun Jul 8 11:25:52 BST 2001
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«
>
--
The KDevelop project: tasin at kdevelop.de <mailto:tasin at kdevelop.de> [www.kdevelop.org <http://www.kdevelop.org>]
--
oohhh sveglia.... il mondo e' ammalato, ma x colpa di chi.........
(Zucchero)
:-------W. Tasin, FB 04,FHM-------------------PGP-KeyID:0x7961A645----------:
<Key-Fingerprint: 1610 835F 0080 32F4 6140 6CF7 A7D0 44CD 7961A645>
-
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