From: Ozgur (ozgur_liste@yahoo.com)
Date: Sat 07 Apr 2001 - 11:38:13 EEST
Merhaba,
# gcc -o kok kok.c -lm
Istersen birde bu sekilde dene...
Iyi Calismalar
On Fri, 06 Apr 2001, you wrote:
> Slm...Yazdigim c programlarinin bazilari linux de derlerken bazi hatalar
> veriyor...ama baska bi yerde derledigimde ornegin turbo c hata falan
> vermeden guzel guzel derliyor..
>
> Ornegin asagidaki basit bi programi bile gcc -o kok kok.c ile derlerken su
> hatayi veriyor:
>
> ----------------------
> /tmp/cc4KusQc.o: In function `main':
> /tmp/cc4KusQc.o(.text+0x4e): undefined reference to `sqrt'
> /tmp/cc4KusQc.o(.text+0x7d): undefined reference to `sqrt'
> collect2: ld returned 1 exit status
> --------------------------------------
> programin kaynak kodu:
>
> #include <stdio.h> /* printf islevi icin */
> #include <math.h> /* sqrt islevi icin */
> main()
> {
> float a,b,c;
> float x1,x2;
> float d;
>
> a=1;
> b=-3;
> c=2;
> d=b*b-(4*a*c);
>
> x1=(-b+sqrt(d))/(2*a);
> x2=(-b-sqrt(d))/(2*a);
> printf("kokler=%f,%f",x1,x2);
> }
>
> ---------------------------
> Ne yapmam gerekiyor?
>
>
>
> Listeden cikmak icin:
> unsub linux
> mesajini listeci@bilkent.edu.tr adresine gonderiniz.
> Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin.
> Listeci arayuzu: http://listweb.bilkent.edu.tr/yardim/bilkent/linux.html
> Liste arsivinin adresi: http://listweb.bilkent.edu.tr/
Listeden cikmak icin:
unsub linux
mesajini listeci@bilkent.edu.tr adresine gonderiniz.
Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin.
Listeci arayuzu: http://listweb.bilkent.edu.tr/yardim/bilkent/linux.html
Liste arsivinin adresi: http://listweb.bilkent.edu.tr/