- 论坛徽章:
- 0
|
具体情况如下:
[syliving@localhost linun]$ cat p126.c
#include <math.h>
main()
{
float x,y;
printf("The program takes x and y from stdin and displays x^y.\n" );
printf("Enter number x:" );
scanf("%f",&x);
printf("Enter number y:" );
scanf("%f",&y);
printf("x^y is%6.3f\n",power((double)x,(double)y));
}
[syliving@localhost linun]$ gcc p126.c -lm -o p126
p126.c: 在函数‘main’中:
p126.c:5: 警告:隐式声明与内建函数‘printf’不兼容
p126.c:7: 警告:隐式声明与内建函数‘scanf’不兼容
/tmp/cc01iATy.o: In function `main':
p126.c: (.text+0x67): undefined reference to `power'
collect2: ld 返回 1
请各位达人指教,这是什么问题,应该怎么解决!小弟在此谢谢大家了!(本人系统fedora11)
[ 本帖最后由 大洛沙鹰 于 2009-8-15 18:35 编辑 ] |
|