Hi All (newbie alert)
Wonder if anyone can help, Caveat - I am new (tonight) to the PlatformIO environment so it could be I’m just being stupid.
I have ported a couple of project over from the Arduino IDE, some of which work perfectly some wont compile correctly - I am getting an error when referencing an include that is part of another library
i.e. If a library cpp file has an include that references another (installed) library when compiling it fails to find the include. As an example I am using RTClib which is a fork of Jeelab’s DS1307RTC library. Within the RTClib.cpp there is an #include <Wire.h> which is an I2C library.
I get the following error at compile time
.pioenvs/espino/RTClib/RTClib.cpp:4:18: fatal error: Wire.h: No such file or directory
Now of course I can copy the Wire.h file into the RTClib library folder and it complies fine but this appears to be occurring on other libraries whenever the above references appear, I have just used RTClib as an example.
I have tried to rebuild the project C++ index but this doesn’t seem to help
my question is therefore two fold
- Is it bad practice to write a library that references another and not include a copy of it within the library folder?
- Is there another solution that will search hierarchically through the libraries i use to see if any others are referenced and include those in the copy to the .pioenvs folder prior to compilation?
I know many of you will cringe when I say this (I have caveated im a newbie) but it works fine in the Arduino IDE - I recognise that doesn’t necessarily make it right But I want to keep my libraries as organised as I can and copying the appropriate .h file to another libraries folder is fraught with risks of version control issues.
Thanks in anticipation
Ric