这个引出的原因是因为你在vscode的_cpp_properties.json中没有指定路径,你可以进行以下操作
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "",
"path": [
"${workspaceRoot}",
"你的SDK路径\\components",
"你的外设驱动路径"
]
},
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
填充完成之后,你只要根据vscode的小黄灯提示,它会自动帮你添加头文件路径