gcc

Kostas Liakakis kostas at rincewind.techpath.gr
Thu Jun 26 09:26:06 EEST 1997


On Thu, 26 Jun 1997, Alexios Chouchoulas wrote:

> On Wed, 25 Jun 1997, Harris Kosmidhs wrote:
> 
>   Xarh, to problhma deixnei na einai to oti den yparxei static libX11.a. Den
> mporeis na kaneis epilektiko static linking. H tha einai ola ta libraries
> dynamically linked, h ola statically linked. Gia na kaneis statically linked

Ki omos mporeis... Apla den symferei :-) Px, to bash exei ginei link thn
readline library alla den yparxei libreadline.so se mena. To idio kai to
ncftp. Apla den tou thn dineis me -l (opou apofasizei analoga me to ti
options tou exeis dosei (-static) alla thn bazeis mazi me ta alla .o
arxeia: gcc -o lala mama.o haha.o hehe.o libtralala.a -lm Fysika etsi
ferneis olh thn library epano sto teliko ektelesimo... 

Telika ena .a arxeio einai san ena matso .o, den exei idiaiterh diafora
gia ton linker. 

> ena X11 programma, prepei na exeis kai static X11 library (libX11*a). An den
> kanw lathos (trexw persino distribution kai afta ta pragmata allazoun), to
> XFree86 den erxetai me static libraries... Prepei na ta kaneis compile monos
> sou.

Nai, genika sthn distribution ton XFree den yparxoun static libraries... 
Einai trela na kaneis link X11 programmata static... kai oxi mono logo tou
mege0ous. 

Oso gia to Xarh,

> > Kano:
> > gcc -L/usr/X11R6/lib -lX11 -lforms -lm -o XX main.c -Wall
> > kai petuxaine.
> > An 3anakano gcc me -static epipleon leei:
> > 
> > /usr/i486-linux/bin/ld: cannot open -lX11: No such file or directory

Apla, exeis mple3ei ligo tis parametrous kai 0eorei to -lX11 san 
./-lX11.c kai psaxnei na to kanei compile... Dokimase kati pio logiko san:
gcc -Wall main.c -o XX -m -L/usr/X11R6/lib -lX11 -lforms 
kai gcc -static -Wall main.c -o XX -m -L/usr/X11R6/lib -lX11 -lforms 

> > 
> > Ti skata einai auto? To /etc/ld.so.conf einai:
> > /usr/local/lib
> > /usr/openwin/lib
> > /tmp/StarOffice-3.1/linux-x86/lib
> > /usr/i486-sysv4/lib
> > /usr/X11R6/include/X11
> > /lib

MHN mplekete to ld.so.conf me ton ld. DEN exoun KAMIA sxesh. O ld blepei 
mono tis biblio0hkes kai ta directories pou tou dineis sto command line, 
den koitazei pou0ena allou.

Tou ld.so omos, tou dynamic linker, teleios diaforetiko prama apo ton ld,
tou einai poly xrhsimo na 3erei se poia directories briskontai oi diafores
libraries pou tou zhta to arxeio pou ekteleitai ekeinh th stigmh. Kai auto
dioti h monh plhroforia pou mpainei mesa sto ektelesimo einai to onoma ths
biblio0hkhs kai h apaitoumenh elaxisth version. Diaforetika an mou edines 
esy kati na tre3o, 0a eprepe na mou peis kai pou exeis ta shared 
libraries, oste na ta balo ki ego sto idio meros...

> > to idio munhma mou bgazei kai an kano compile me:
> > gcc -lX11 -lforms -lm -o XX main.c -Wall

Dokimase na to grapseis opos sou deixno parapano, oxi oti 0a pai3ei, alla 
0a sou bgalei to sosto mynhma la0ous :-)

-K.


--
====================================================================
Gia na mathete pos na xrisimopoiite ton majordomo, stilte e-mail
sto "majordomo at argeas.argos.hol.gr" me 1 grammi sto keimeno: help
Ta archives tis listas einai sto http://www.argos.hol.gr/lists
Gia opoiodipote problima stilte  e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list