vscode c/c++ moudle 配置

最近发现用c刷leetcode效率太低了,于是重新拾起学了一半的c++

我采用vscode来编辑cpp文件,无奈在windows环境下,vscode默认配置的c/c++编译器是msvs(微软的编译器),无法自动找到MinGw的头文件,std名称空间也会报错,身为强迫症的我很不爽,翻了许多博客,发现他们都是配置编译调试环境,没有解决我的问题

最后在github issues里面翻到了,现在把配置贴出来,备忘

{
    "configurations": [
        {
            "name": "MinGW",
            "intelliSenseMode": "gcc-x64",
            "compilerPath": "D:/mingw-w64/bin/g++.exe",
            "browse": {
                "path": [
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": true
            },
            "includePath": [
                "${workspaceFolder}"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}

转载于:https://www.cnblogs.com/WuLiaoTC/p/10358975.html

你可能感兴趣的:(vscode c/c++ moudle 配置)