1. 报错libmingw32.a(main.o)😦.text.startup+0xc0): undefined reference to `WinMain@16’
VsCode第一次编写C语言
#include <stdio.h>
int main()
{
printf("hello world\n");
}
之后点击运行(安装vsCode插件Code Runner)报错
[Running] cd "f:\Space\CSpace\first\" && gcc hello.c -o hello && "f:\Space\CSpace\first\"hello
e:/apk/c/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: e:/apk/c/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
[Done] exited with code=1 in 0.232 seconds
解决方法:
VsCode点击运行–>添加配置,选中C++(Gcc/LLDW)–>接着选中gcc.exe…文件

之后点击运行即可
在使用VsCode初次运行C语言时遇到错误:libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16'。通过安装Code Runner插件并配置C++(Gcc/LDDW),选择gcc.exe…文件后,成功解决运行报错问题。
1277

被折叠的 条评论
为什么被折叠?



