vscode使用mingw编译配置
时间: 2024-01-13 20:19:39 浏览: 87
在VSCode中使用MinGW编译器进行配置的步骤如下:
1. 确保已经安装了MinGW编译器。如果没有安装,可以从MinGW官网下载并安装。
2. 打开VSCode,点击左侧的扩展图标,搜索并安装"C/C++"扩展。
3. 在VSCode中打开一个C或C++项目文件夹。
4. 在项目文件夹中创建一个名为".vscode"的文件夹(如果已经存在则跳过此步骤)。
5. 在".vscode"文件夹中创建一个名为"C_Cpp_properties.json"的文件。
6. 在"C_Cpp_properties.json"文件中添加以下内容:
```json
{
"configurations": [
{
"name": "MinGW",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
```
请注意,上述配置中的"compilerPath"字段需要根据你的MinGW安装路径进行修改。
7. 保存并关闭"C_Cpp_properties.json"文件。
现在,你已经成功配置了VSCode使用MinGW编译器。你可以在VSCode中打开一个C或C++源文件,并使用快捷键"Ctrl + Shift + B"来编译和运行你的代码。
阅读全文
相关推荐
















