I’m trying to keep some of my project factored into private libraries in the hope of keeping elements self-contained and exposing features through public methods.
When I do that, I have two main problems…
When I build from within the IDE, the errors show in the console for files belonging to a copy of my source file.
It’s awesome to have the IDE hyperlink the error, but unfortunately it’s opening up the .pioenvs copy of the source file
Is there any way to set up the project to use the source file directly, or to “fix” the error link to open the actual source file when clicked?
The private library source files are not showing as source files of the project.
I expect that the lib/Display/src/ files be enabled and actively part of the project. And the main reason for wanting that is the IDE seems to ignore the file and the mistakes within it, even while editing it.
This is what I expect:
And this is what happens with a “non-project” file from the libs/ directory:
(The _tft.fillScreen( call should have a highlight and a suggestion from the IDE to fix it)
I’ve tried putting the .h/.cpp files directly in the ‘lib/Display’ library folder, and as shown here in the ‘lib/Display/src’. I don’t find any difference between them.
Maybe both issues are related? And the normal assistance you get from the IDE pointing out errors is missing because it’s “pre-compiling” the project and the errors are in the .pioenvs directory structure and it doesn’t know to highlight the actual source file?
Either way, I find both error message clicking, and error/warning highlighting within project files very helpful… I’m hoping it’s just me doing something wrong, or somehow solvable.
arm-none-eabi-ar rcs .pioenvs/teensy31/libSPI.a .pioenvs/teensy31/SPI/SPI.o
.pioenvs/teensy31/Display/Display.cpp: In constructor 'Display::Display(int8_t, int8_t, int8_t, int8_t)':
.pioenvs/teensy31/Display/Display.cpp:18:16: error: request for member 'needsBackground' in '((Display*)this)->Display::_tftUpdate', which is of pointer type 'TFTUpdate*' (maybe you meant to use '->' ?)
_tftUpdate.needsBackground = true;
I test source code very well before committing. What is more, we have a lot of different integration tests. I would be thankful if you will use v3 and report any problems (I’m not sure that you will have them).
Nevertheless, I’m going to release the first public beta of PlatformIO 3.0 next week. Need to finish with new Library Manager. Here is the commits history. If you will see new critical commits, please repeat pip install https://github.com/platformio/platformio/archive/feature/platformio-30.zip in your python virtual environment.
I’m getting a library import error (missing a define) when I switch to 3. Where should I log that? A new post here, or in GitHub? (Error is in both command-line, and CLion IDE)