C语言报错
报错
……\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o) In function ‘main’:
……\src\mingw-w64-v3-git\mingw-w64-crt\crt\crt0_c.c undefined reference to WinMain’
[Error] ld returned 1 exit status
原因
没有找到main函数
写个小例子测试一下
#include<stdio.h>
int fun() {
return 0;
}
结果就会出现上面的错误。
当然调用没有定义的函数,也会报错
#include<stdio.h>
int fun() {
return 0;
}
int main() {
yylex();
return 0;
}
undefined reference to `yylex’