Dependency Issue? Can't find header file

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:
Screen Shot 2022-04-21 at 3.23.27 PM
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!
Screen Shot 2022-04-21 at 3.58.06 PM
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!

Remove the .pio folder again to get a clean starting point, add lib_ldf_mode = chain+ to the platformio.ini and retry. What’s the dependency graph now with which platformio.ini?

Thanks for the quick response! I added lib_ldf_mode = chain+ to the platformio.ini for both the SlicBus and FireScript modules and did a clean rebuild of both (deleting .pio) for SlicBus first and then FireScript. No issues with SLicBus, but I got exactly the same error message for FireScript (can’t find SlicBus.h). The dependency graph for FireScript is now:

Unpacking  [####################################]  100%
Library Manager: elapsedMillis @ 1.0.6 has been installed!
Library Manager: Installing file:///Users/keith/Documents/PlatformIO/Projects/EFD_libraries/SlicBus
Library Manager: CRC @ 0.3.0 has been installed!
Library Manager: Installing file:///Users/keith/Documents/PlatformIO/Projects/EFD_libraries/ColorUtilsHsi
Library Manager: ColorUtilsHsi @ 0.0.0+20220421161319 has been installed!
Library Manager: Installing file:///Users/keith/Documents/PlatformIO/Projects/EFD_libraries/SdFileMgr
Library Manager: SdFileMgr @ 0.0.0+20220421161319 has been installed!
Found 97 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <elapsedMillis> 1.0.6
|-- <CRC> 0.3.0
|-- <ColorUtilsHsi> 0.0.0+20220421161319
|-- <SdFileMgr> 0.0.0+20220421161319
|   |-- <SPI> 1.0
|   |-- <SD> 2.0.0
|   |   |-- <SdFat> 2.1.0
|   |   |   |-- <SPI> 1.0
|   |   |-- <SPI> 1.0
|   |-- <SdFat> 2.1.0
|   |   |-- <SPI> 1.0
|-- <SPI> 1.0
|-- <SD> 2.0.0
|   |-- <SdFat> 2.1.0
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <SdFat> 2.1.0
|   |-- <SPI> 1.0
Building in release mode
Compiling .pio/build/teensy40/src/Dispatcher.cpp.o
Compiling .pio/build/teensy40/src/EffectDefs.cpp.o
Compiling .pio/build/teensy40/src/ElementDefs.cpp.o
Compiling .pio/build/teensy40/src/Executive.cpp.o
src/Dispatcher.cpp:2:21: fatal error: SlicBus.h: No such file or directory

It’s interesting that the Library Manager says that it’s “Installing…SlicBus” but then says “CRC @ 0.3.0 has been installed!”, but not that SlicBus was installed. That seems like a clue.

Oh yeah, one other thing: I removed all CRC dependencies and references from SlicBus (commenting out some code), and then FireScript compiles fine and shows SlicBus in the dependency graph.