总结
坑~~~~~~~~~~~~~~~~
配置期间出现的问题:
1、VS Code配置C++环境: Unable to start debugging. Unexpected GDB output from command报错
解决方法:
-
检查MinGW是否安装成功
在命令行窗口输入
g++ version
会出现
g++: error: version: No such file or directory
g++: fatal error: no input files -
工作目录不能有中文!
注意,打开的程序名称以及程序存放路径也都不能有中文!
反正就是路径不能有中文
2、vscode检测到#include错误,请更新includePath。
解决方法:参考下面的文章
https://blog.csdn.net/weixin_44718794/article/details/106751513
3、编译成功但命令行窗口会闪退
解决方法:
在return 0;
前面加上system("pause");
如:
#include<stdio.h>
#include<math.h>
int main(){
printf("111dasdasdadasdas\n" );
system("pause");//加上这一行
return 0;
}