lib/EEPROMManager/EEPROMManager.h:2:20: fatal error: EEPROM.h: No such file or directory
When I remove #include <EEPROM.h> from EEPROMManager.h, the build works.
In EEPROMManager.h, if I now include the full path: #include "/home/myuser/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src" The build works.
In short, as soon as EEPROMManager.h includes EEPROM.h, the build fails. I do not understand why.
I checked c_cpp_properties.json, EEPROM.h is included.
It look like only header files (.h) can’t find EEPROM.h.
to the platformio.ini and show the library dependencies tree in the preamble of a verbose compilation? (pio run -v or Verbose Compile in the VSCode tasklist)
This didn’t fix the issue.
My file tree is actually a lot more complex than what I put in my original post. I tried to reproduce the issue in a new project with a simpler file structure, but it didn’t work.
So here’s my full dependency graph:
And the error messages caused by adding #include <EEPROM.h> to EEPROMManager.h:
In file included from lib/WiFiManager/WiFiManager.h:2:0,
from lib/WiFiManager/WiFiManager.cpp:3:
lib/EEPROMManager/EEPROMManager.h:2:20: fatal error: EEPROM.h: No such file or directory
****************************************************************
* Looking for EEPROM.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:EEPROM.h"
* Web > https://platformio.org/lib/search?query=header:EEPROM.h
*
****************************************************************
compilation terminated.
*** [.pio/build/esp32dev/lib97c/WiFiManager/WiFiManager.cpp.o] Error 1
In file included from lib/WiFiManager/WiFiManager.h:2:0,
from lib/TimeManager/TimeManager.cpp:3:
lib/EEPROMManager/EEPROMManager.h:2:20: fatal error: EEPROM.h: No such file or directory
****************************************************************
* Looking for EEPROM.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:EEPROM.h"
* Web > https://platformio.org/lib/search?query=header:EEPROM.h
*
****************************************************************
compilation terminated.
*** [.pio/build/esp32dev/lib6a6/TimeManager/TimeManager.cpp.o] Error 1
============================================================================= [FAILED] Took 10.04 seconds =============================================================================
The terminal process terminated with exit code: 1
By the way, thanks a lot for helping me with this.
Then the minimal example has something that your non-working whole project does not. Are you able to upload the full project to github for reproduction?
I just noticed something odd: The dependency graph remains the same, whether it works or not.
It looks like this will all remain a mystery. For now, as a workaround, I can make it work including this in EEPROMManager.h: #include “…/…/…/…/…/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src/EEPROM.h”
If you could get a minimal project in which this error occurs this would be great. Maybe by partly porting back parts of the non-working project. Without reproducibility this is rather hard to fix :/.
Another way without having to hack in the include path in the source file is to add an -I flag with a static path to the library (which is a hack in itself…).
Looking at the error you mentioned before… I’d be looking at how it’s relates to WifiManager? Perhaps the header file is mentioned there inside a #ifdef conditional block?
Warning! Circular dependencies detected between `/Users/ikravets/Downloads/Pio-10016-master/lib/ScheduleManager` and `/Users/ikravets/Downloads/Pio-10016-master/lib/EEPROMManager`
Warning! Circular dependencies detected between `/Users/ikravets/Downloads/Pio-10016-master/lib/WiFiManager` and `/Users/ikravets/Downloads/Pio-10016-master/lib/EEPROMManager`
Hi All
Im having the same issues. My header.h file is in \include and .cpp is in \src i have tried all versions of build_flags both singlarly and differnt combinations. It is staring to drive me a little bit nuts. build_flags =, I- include, I- C:\Users\bucko\OneDrive\aElectronics\Projects\BuckosLearning-PH7\include, I- C:\Users\bucko\OneDrive\aElectronics\Projects\BuckosLearning-PH7\include\blProjConfig_PH7.h .