gcc -static

Christos Ricudis ricudis at paiko.gr
Sat Feb 10 14:56:01 EET 2001


Hello Nikos!

  On 10 Feb 01, Nikos Mavroyanopoulos wrote to All with subject "gcc -static":


 NM> Αν θελω να χρησιμοποιησω τον gcc για να κανω link με την libc
 NM> (πχ) static και την libz shared, ποιες παραμετρους χρησιμοποιω. Αν
 NM> βαλω -static τοτε πανε ολες static, ενω με την -shared ολες shared.

Prwta prwta, to -shared option ston gcc DEN leei ston linker na kanei link me
tis shared libraries. Ayto to leei h option -Bdynamic. H option -shared leei
ston gcc na /paragei/ shared libraries. 

Apo kei kai pera, gia na mhn prhzesai me to -nostdlibs option, poy 8a se
anagkasei na psaxneis na breis 15 preamble files, 8a kaneis ayto : 

Shared libc, shared libcrypt, static libX11, static libXext : 

gcc -o papari papari.o -Bdynamic -lcrypt /usr/X11/lib/libX11.a
/usr/X11/lib/libXext.a

Static libc, static libcrypt, shared libX11, shared libXext : 

gcc -o papari papari.o -Bstatic -lcrypt /usr/X11/lib/libX11.so
/usr/X11/lib/libXext.so 

Bebaia an 8eleis mporeis na baleis oles tis biblio8hkes me t'onoma toys, kai na
ksexaseis to -llib, opote to -Bstatic/-Bdynamic orizei aplws to link mode ths
libc. 


--
Christos Ricudis

In God we trust.
All others must present a valid X.509 certificate.



More information about the Linux-greek-users mailing list