安装编译器
- 点击file
- 下载x86_64-posix-seh或者x86_64-win32-seh
添加环境变量
验证
- 在cmd.exe中输入如下命令:
- gcc -v -E -x c++ -
Vscode配置
- 新建hello.c
#include<stdio.h>
int main() {
printf("hello world\n");
return 0;
}
- 新建hello.cpp
#include <iostream>
using namespace std;
int main() {
cout<<"kdjaksl";
return 0;
}
- 进入调试界面添加配置环境,选择 C++(GDB/LLDB),再选择 g++.exe,之后会自动生成 launch.json 配置文件