need help
ggbg ddfd
ggbgbg@abv.bg
Tue Jul 22 13:39:00 GMT 2003
After compiling this simple program
#include <stdio.h>
#include <math.h>
int main(void)
{
printf("%d", sqrt(10));
return 0;
}
with this makefile
new : new.o
cc -o new new.o
new.o : new.c
cc -c new.c
clean :
rm new.o
cleanall :
rm new new.o
I recieved the following errors
[e@localhost e]$ man gcc
[e@localhost e]$ cd programing
[e@localhost programing]$ make
cc -o new new.o
new.o: In function `main':
new.o(.text+0x14): undefined reference to `sqrt'
collect2: ld returned 1 exit status
make: *** [new] Error 1
[e@localhost programing]$
Then I tried
[e@localhost programing]$ gcc -o new new.c
/tmp/ccDwfMtN.o: In function `main':
/tmp/ccDwfMtN.o(.text+0x14): undefined reference to `sqrt'
collect2: ld returned 1 exit status
[e@localhost programing]$
THIS DOESN'T WORK PROPERLY
please tell me why,
I'm running Mandrake Linux release 8.2 for i586
Kernel 2.4.18-6 mdk on an i868
with gcc-2.96
Please,
send me answer as soon as posible.
-----------------------------------------------------------------
http://kino.GBG.bg - ÍÀ×ÀËÎ | ÊÈÍÎ ÏÐÅÌÈÅÐÈ | ÏÐÎÃÐÀÌÀÒÀ | ÍÎÂÈÍÈ | DVD È ÂÈÄÅÎ | ÊÈÍÎ ÈÑÒÎÐÈß
More information about the Gcc
mailing list