gcc demo.c max.c 報(bào)錯(cuò) 識(shí)別不到max方法 不是說gcc可以自動(dòng)識(shí)別么?
gcc demo.c? max.c?
demo.c: In function ‘main’:
demo.c:7:18: warning: implicit declaration of function ‘max’; did you mean ‘main’? [-Wimplicit-function-declaration]
? ? ?int maxNum = max(a1,a2);
? ? ? ? ? ? ? ? ? ^~~
? ? ? ? ? ? ? ? ? main
代碼如下:
#include <stdio.h>
// #include "max.c"
int main()
{
? ? int a1 = 30;
? ? int a2 = 32;
? ? int maxNum = max(a1,a2);
? ? printf("the max value is %d\n",maxNum);
? ? return 0;
}
2019-08-13
版本問題。報(bào)錯(cuò)后你運(yùn)行./a.out程序還是能成功運(yùn)行的