Bug#27127: make ignores "-static" when linking

ender at uol.com.br ender at uol.com.br
Wed Jun 13 00:02:22 UTC 2001

Package: kdevelop
Version: 1.4.1 (using KDE 2.1.1 )
Severity: normal
Installed from:    SuSE
Compiler:          gcc version 2.95.2 19991024 (release)
OS:                Linux 2.4.0 i686
OS/Compiler notes: 


I have a problem generating a Terminal C++ program. If I accept de default configuration from the Project Wizard the created binary will use shared library (the default option from the Wizard). 
But I do want a static library program, so I select Project->Options->Linker Options->prevent using shared libraries. But it DO NOT WORKS.

To see what I'm saying please:
a) create the basic Terminal C++ program from the Wizard (the "Hello Word!")
b) select Project->Options->Linker Options->prevent using shared libraries
c) click Rebuild. The Kdevelop generates the program, but still with shared library (the same binary!) 
d) reading the messages from the make process, you will find at the bottom (without the numbers):

1> make[1]: Entering directory 
2> `/home/ender/projects/test/test'
3> g++ -DHAVE_CONFIG_H -I. -I. -I..     -O0 -g3 -Wall    -c main.cpp
4> /bin/sh ../libtool --mode=link g++  -O0 -g3 -Wall    -static  -o test   main.o  
5> mkdir .libs
6> g++ -O0 -g3 -Wall -o test main.o 
7> gmake[1]: Leaving directory 
9> *** success ***

In line <4> you see the "-static" option during the compiling time (fine here). But during the linking time (in line 6) the "-static" option DO NOT APPEAR, so the binary uses shared memory. If you try:
"g++ -O0 -g3 -Wall -static -o test main.o" (please note I've included "-static" by hand) in a Terminal, then the generated binary will be 100% OK.

thank you,


(Submitted via bugs.kde.org)
(Called from KBugReport dialog)

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

More information about the KDevelop-devel mailing list