I’ve been using PIO for over a year, and it’s greatly increased my productivity. But every once in a while I encounter a mysterious problem that is very difficult to resolve. My current problem is that when compiling my program (FireScript.cpp) the compiler complains about not finding a header file (CRC16.h) that’s used by one of my private library modules (SlicBus.cpp). This library module compiles just fine. It includes CRC16.h and the platformio.ini file looks like this:
[env:teensy40]
platform = teensy
board = teensy40
framework = arduino
lib_deps =
robtillaart/CRC @ ^0.3.0
The FireScript.cpp program includes SlicBus.h, and its platformio.ini looks like this:
[env:teensy40]
platform = teensy
board = teensy40
framework = arduino
lib_deps =
elapsedMillis
lib_extra_dirs =
/Users/keith/Documents/PlatformIO/Projects/EFD_libraries
My library folder (…/EFD_Libraries) contains the SlicBus module and several others used by this program. No problems with those other modules, just SlicBus. Here’s the last part of the compiler output:
The weird thing is that the libdeps folder looks like this:
The CRC16.h file is inside the CRC folder, so I don’t understand why it’s not being found.
I also don’t understand why there are two CRC folders, and why the many other dependencies aren’t listed. There’s probably something basic here that I’m not understanding…
I tried a different approach where I explicitly list each of the library module dependencies:
lib_deps =
elapsedMillis
/Users/keith/Documents/PlatformIO/Projects/EFD_libraries/SlicBus
/Users/keith/Documents/PlatformIO/Projects/EFD_libraries/ColorUtilsHsi
/Users/keith/Documents/PlatformIO/Projects/EFD_libraries/SdFileMgr
But now the compiler can’t even find the SlicBus.h header file (it hasn’t moved). The libdeps folder now correctly lists all the dependencies, except for SlicBus!
And if it helps:
Dependency Graph
|-- <elapsedMillis> 1.0.6
|-- <CRC> 0.3.0
|-- <ColorUtilsHsi> 0.0.0+20220421154638
|-- <SdFileMgr> 0.0.0+20220421154638
| |-- <SD> 2.0.0
| | |-- <SdFat> 2.1.0
| | | |-- <SPI> 1.0
| |-- <SPI> 1.0
How did it figure out the CRC dependency if it couldn’t find SlicBus (the only module that uses CRC)?
Can someone please help me climb out of my pit of confusion?
Thanks!