Can't find files that I know exist in a project that compiled yesterday [SOLVED]

Hey I just wanted to write a post about something that just happened to me.

When I start to code, I grab the last state of my project, copy it, and paste it, update the date, and maybe add a note about what I was working on that day.

I did that this morning and started getting compile errors about library dependency files not existing.

After a little bit of head scratching I came to the conclusion that the compiler must be generating absolute file paths while going through my dependencies. I think that the file paths got too long when I changed the name of the project directory, and suddenly PlatformIO couldn’t read the files.

Just move the project directory to directory that is closer to the root directory of your system and that seems to fix that problem.

Hopefully that helps someone out there!

Also - I was wondering if it would be possible to make a more detailed compiler error for when this happens?

Here is an example of my compiler output:

Compiling .pio\build\teensy36\src\main.cpp.o
Compiling .pio\build\teensy36\lib5c8\External_ADC_Class\ADS1015.cpp.o
Compiling .pio\build\teensy36\lib5c8\External_ADC_Class\External_ADC_Class.cpp.o
Compiling .pio\build\teensy36\lib14a\Gen3_SPI\Gen3_SPI.cpp.o
In file included from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson/Array/../Variant/../Misc/../Strings/../Memory/../Variant/VariantSlot.hpp:8:0,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson/Array/../Variant/../Misc/../Strings/../Memory/MemoryPool.hpp:9,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson/Array/../Variant/../Misc/../Strings/StringAdapters.hpp:7,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson/Array/../Variant/../Misc/SerializedValue.hpp:7,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson/Array/../Variant/VariantData.hpp:7,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson/Array/ArrayRef.hpp:7,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson.hpp:17,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson.h:9,
                 from lib\T36_Time/..\..\include\..\lib\ArduinoJson\ArduinoJson.h:5,
                 from lib\T36_Time/..\..\include\includes.h:8,
                 from src\main.cpp:4:
lib\T36_Time/..\..\include\..\lib\ArduinoJson\src/ArduinoJson/Array/../Variant/../Misc/../Strings/../Memory/../Variant/../Polyfills/type_traits.hpp:9:45: fatal error: type_traits/integral_constant.hpp: No such file or directory
compilation terminated.

This is unfortunate effect of the way ArduinoJson uses include paths. The author has now fixed it and it should be available with the upcoming release 6.12.

Also see:

2 Likes

Yes, I saw a few other posts that had mentioned it after I wrote mine.

Thanks for taking the time to reply to my post.

1 Like