打开c文件夹下的.vscode文件夹下的c_cpp_properties.json,复制以下代码
{
"configurations": [{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"D:/MinGW/mingw64/x86_64-w64-mingw32/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceRoot}",
"D:/MinGW/mingw64/x86_64-w64-mingw32/include"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}],
"version": 3
}
注意到代码中的两个"D:/MinGW/mingw64/x86_64-w64-mingw32/include",改成与自己匹配的路径。
如果按我之前说的装MInGW,则不需要改路径。