Get 「Error Presented: #include errors detected」 when opening a project
The error message is Error Presented: #include errors detected. Please update your includePath.json
This is an issue coming from the Microsoft C/C++ extension. Switch the IntelliSense engine to 「Tag Parser」 can fix this issue:ui
- Press F1 and key in ‘settings’ and select the
Preference: Open User Settings
- Set the IntelliSense engine to 「Tag Parser」
- Press F1 and key in ‘cpp’ and select the
C/Cpp: Edit Configurations
- Open the c_cpp_properties.json file, add the path of Arduino package into the include path
You can get more detail from C/C++ for VS Code.this
以上是英文原版教程,我補充兩點:spa
1.第一步先改IntelliSense engine 中的Default選項爲 「Tag Parser」;code
2.第二步改c_cpp_properties.json blog
默認安裝路徑爲C:\Users\SANG-ASUS\AppData\Local\Arduino15\packages\AZ3166\hardware\stm32f4教程
(個人用戶名是SANG-ASUS,改爲你本身的)get
因此在c_cpp_properties.json 裏改的是這樣的:it
粘貼:io
,"C:\\Users\\SANG-ASUS\\AppData\\Local\\Arduino15\\packages\\AZ3166\\hardware\\stm32f4"
這時候就不會提示報錯了,而且能夠F12查看定義了!