I have a project which for practical reasons I have added a sub-directory to. It looks something like this:
> Sketch
Sketch.ino
Module.h
Module.cpp
> Resources
Rsc1.h
Rsc1.cpp
I am having a couple of problems with this arrangement:
-
it is not possible to navigate to the Resources directory within IDE2.x.x using the built-in navigator. Navigation stops at the Sketch directory and does not expand any further down to view Resources. This means I have to use an external editor to work with files in the sub-directory.
-
The compiler apparently finds the Rsc1.h file even if a relative path to thw main directory is used, but fails to include the functions in Rsc1.cpp. The linker then complains about undefined references to all the functions found in Rsc1.cpp.
There was a similar post some 3 years ago which I imagine related to IDE 1.8.x:
It would seem that the same appears to still apply IDE 2.3.x?
The workaround seems to be to either stick with a flat directory structure which is becoming a bit unwieldy. Another option is to use full paths as mentioned in the linked discussion which I have tried, but with no change in result. I guess the other option is to stick with the flat project structure or else use another IDE.
I was hoping that this problem had been resolved in IDE2? Perhaps I am missing something but a single #include for the .h file was sufficient to include both .h and .cpp into the project for all the other .h/.cpp pairs that I have in the Sketch directory, i.e at the same level as the .ino file.
If I deliberately mis-spell the file path then the IDE tells me that it can't find the file, so it does appear to be finding it, just not importing the functions for some reason.