Skip to content

Editor Erroneously Marks Included Headers as "Not Found" Yet The Program Compiles and Runs #1654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emintz opened this issue Jul 6, 2024 · 2 comments

Comments

@emintz
Copy link

emintz commented Jul 6, 2024

The IDE editor marks included headers as not found when they exist. The program compiles just fine.

For example, one of my experimental sketches includes three headers:

#include "Arduino.h"
#include <freertos/FreeRTOS.h>
#include <tusb.h>

The editor recognizes Arduino.h, but marks freertos/FreeRTOS.h and tusb.h unresolved.

Environment:

IDE: Sloeber application version 4.4.3.202402070201
Target: ESP32 S3 Development Module
ESP32 Library Version: 3.0.2

I have set build.fqbn, build.variant, and runtime.os as directed in issue
1652

I had to disable automatic include resolution to prevent Sloeber from automatically including the nI2C_master library in my project.

I'd love to help with this if you can get me started. I'll look at the code, but probably will need a bit of orientation to get me going.

@jantje
Copy link
Member

jantje commented Jul 6, 2024

Probable root cause
ESP is a very special platform and there are currently quite a bit of problems with the "discovery phase".
If the project builds fine but the indexer gives problems that is caused by a failing "discovery"
For the discover the compile commands are run and provide include folders and defines. If it fails you should have at least 2 errors in the error log (because the discovery is run for both c and cpp command). The failing happens because Sloeber is not yet completely initialized and does not expand/provide the commands properly.

workaround:
Unfortunately there is no button to restart the discovery and CDT behavior in this area is different between different versions.
What is cumbersome but always worked for me is changing the "discovery command" (in project properties). in many cases changing the board (FI to uno "apply and close" and back to ESP) will work as well.

To change the discovery command
image
Add/remove a space and select apply close

Other thoughts:

  1. #include <freertos/FreeRTOS.h> should that not be #include <FreeRTOS.h>?
  2. The indexer is case sensitive and the build on windows is less case sensitive; so casing can cause indexer issues that are not visible in the build.
  3. I'm working on a new sloeber which will change this completely (hopefully it will turn out much better)

@emintz
Copy link
Author

emintz commented Jul 7, 2024

Update: downgrading from ESP library 3.0.2 to 2.0.17 resolves the issue. The new library is not backward compatible.

@emintz emintz closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants