निम्न प्रोग्राम gcc में संकलित नहीं कर सकता है। लेकिन यह .c
एक्सटेंशन के साथ जी ++ और एमएससी ++ के साथ ठीक है।एक gcc sqrt फ़ंक्शन बग?
#include <math.h>
#include <stdio.h>
int main()
{
double t = 10;
double t2 = 200;
printf("%lf\n", sqrt(t*t2));
return 0;
}
मेरा सिस्टम CentOS, संस्करण जानकारी है।
> gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
त्रुटि जानकारी:
> gcc test.c
/tmp/ccyY3Hiw.o: In function `main':
test.c:(.text+0x55): undefined reference to `sqrt'
collect2: ld returned 1 exit status
यह एक बग है?
कोई भी मेरे लिए परीक्षण कर सकता है?
यह भी देखें http://stackoverflow.com/questions/1033898 – ephemient