gcc demo.c max.c 报错 识别不到max方法 不是说gcc可以自动识别么?
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;
}