Good time.
I have several dozen of my own libraries for ESP32. All of them are in a separate folder from the project: c:\PlatformIO\libs, as they are used in several projects at once.
c:\PlatformIO\libs\certs\
c:\PlatformIO\libs\clouds\reMqtt\
c:\PlatformIO\libs\clouds\reNarodMon\
c:\PlatformIO\libs\clouds\reOpenMon\
c:\PlatformIO\libs\clouds\reTgSend\
c:\PlatformIO\libs\clouds\reThingSpeak\
c:\PlatformIO\libs\consts\
c:\PlatformIO\libs\peripherals\reAlarm\
c:\PlatformIO\libs\peripherals\reBeep\
c:\PlatformIO\libs\peripherals\reDS1307\
c:\PlatformIO\libs\peripherals\reElTariffs\
c:\PlatformIO\libs\peripherals\reGpio\
c:\PlatformIO\libs\peripherals\reLed\
c:\PlatformIO\libs\peripherals\reLedSys\
c:\PlatformIO\libs\peripherals\reLoadCtrl\
c:\PlatformIO\libs\peripherals\reMCP23017\
c:\PlatformIO\libs\peripherals\rePCF8574\
c:\PlatformIO\libs\peripherals\reRangeMonitor\
c:\PlatformIO\libs\peripherals\reRTC\
c:\PlatformIO\libs\peripherals\reRx433\
c:\PlatformIO\libs\sensors\reADC\
c:\PlatformIO\libs\sensors\reAHT1x\
c:\PlatformIO\libs\sensors\reAM232x\
c:\PlatformIO\libs\sensors\reBME68x\
c:\PlatformIO\libs\sensors\reBME280\
c:\PlatformIO\libs\sensors\reBMP280\
c:\PlatformIO\libs\sensors\reCCS811\
c:\PlatformIO\libs\sensors\reDHTxx\
c:\PlatformIO\libs\sensors\reDS18x20\
c:\PlatformIO\libs\sensors\reHTU2x\
c:\PlatformIO\libs\sensors\reMoisture\
c:\PlatformIO\libs\sensors\reSensor\
c:\PlatformIO\libs\sensors\reSHT3x\
c:\PlatformIO\libs\system\reCerts\
c:\PlatformIO\libs\system\reEsp32\
c:\PlatformIO\libs\system\reEvents\
c:\PlatformIO\libs\system\reI2C\
c:\PlatformIO\libs\system\reNotifier\
c:\PlatformIO\libs\system\reNvs\
c:\PlatformIO\libs\system\reOTA\
c:\PlatformIO\libs\system\reParams\
c:\PlatformIO\libs\system\reScheduler\
c:\PlatformIO\libs\system\reStates\
c:\PlatformIO\libs\system\reSysInfo\
c:\PlatformIO\libs\system\rLog\
c:\PlatformIO\libs\system\rStrings\
c:\PlatformIO\libs\system\rTypes\
c:\PlatformIO\libs\wifi\rePinger\
c:\PlatformIO\libs\wifi\reSNTP\
c:\PlatformIO\libs\wifi\reWiFi\
The paths to them are specified in platformio.ini:
lib_extra_dirs =
C:\PlatformIO\libs\system
C:\PlatformIO\libs\peripherals
C:\PlatformIO\libs\sensors
C:\PlatformIO\libs\wifi
C:\PlatformIO\libs\clouds
C:\PlatformIO\libs
Until some time everything worked. Now, when trying to change something in the project, an error is generated that one random library from the OLD ones that previously worked successfully was not found:
C:/PlatformIO/libs/system/reStates/src/reStates.cpp:26:12: fatal error: reNotifier.h: No such file or directory
********************************************************************
* Looking for reNotifier.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:reNotifier.h"
* Web > https://registry.platformio.org/search?q=header:reNotifier.h
*
********************************************************************
#include "reNotifier.h"
Although yesterday everything worked fine in this very place.
In addition, I discovered the following problem: if I disable a particular library using preprocessor conditions, it still compiles. I tested it by messing up some of the code inside it but with the exact same condition, which is guaranteed to result in an error. For example:
#define CONFIG_OPENMON_ENABLE 0
....
#if CONFIG_OPENMON_ENABLE
#include "reOpenMon.h"
#endif // CONFIG_OPENMON_ENABLE
Inside reOpenMon.h the error is framed in
#if !CONFIG_OPENMON_ENABLE
bug();
#endif // !CONFIG_OPENMON_ENABLE
In theory, there should be no compilation errors, since the entire library is excluded from the project. But no! Compiler says bug() not found