vscode C++ 环境搭建
1.安装mingw-w64
- 下载mingw-w64、安装、配置环境变量
- 注:认准mingw-w64
- powershell or cmd,键入命令gcc -v,若显示版本号,那就成功啦
2.安装C/C++插件
-
需要配置 3 个文件,阅读以下文件中的注释
- c_cpp_properties.json
- tasks.json
- launch.json
-
c_cpp_properties.json
设置头文件、编译器的目录。
-
注:此文件不允许注释,记得删除
{ "configurations": [ { "name": "Win32", "includePath": [ //includePath 头文件目录 "${workspaceFolder}", "S:/Env/LLVM/include", "S:/Env/LLVM/lib/gcc/x86_64-w64-mingw32/8.1.0/include", "S:/Env/openGL/include" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "compilerPath": "S:/Env/LLVM/bin/gcc.exe", //user\mingw\bin\gcc.exe 需要自己配置 "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "clang-x64", "browse": { //includePath 头文件目录 "path": [ "${workspaceFolder}", "S:/Env/LLVM/include", "S:/Env/LLVM/lib/gcc/x86_64-w64-mingw32/8.1.0/include", "S:/Env/openGL/include" ],
-