Vs code第一次运行C语言报错问题

2022-07-04 10:06:23

1. 报错libmingw32.a(main.o)😦.text.startup+0xc0): undefined reference to `WinMain@16’

VsCode第一次编写C语言

#include<stdio.h>intmain(){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 returned1 exit status[Done] exited with code=1 in0.232 seconds

解决方法:
VsCode点击运行–>添加配置,选中C++(Gcc/LLDW)–>接着选中gcc.exe…文件
在这里插入图片描述
之后点击运行即可

  • 作者:有意思!!!
  • 原文链接:https://blog.csdn.net/why_study_it/article/details/121050838
    更新时间:2022-07-04 10:06:23