Heres what I did: I want to setup my RedBoard with the Adafruit TFT. To test it, i followed this Tutorial (designed for Arduino IDE).
I opened Particle IDE
I created a new App.
I included the two libraries mentioned in the tutorial. The references to the header and the comment implying it did so were added to my file.
I copied the full example source code from github (Repo) and removed the two (previously automatically added) include statements.
I tried veryfing the code and ended up with about 15 more error messages as above. They simply concerened different functions.
I checked the library files and there weren’t multiple implemenations of the same funcitons. Neither did I include the same header file multiple times. Am I doing something obviously wrong? Or are the libraries only cut out for Arduino platform?
If you are using Web IDE it’s best to post a SHARE THIS REVISION link so we can have a look at an exact copy of your project (including library setup).
This makes pinpointing your issues much easier for us.
The reason for your double definitions is that the Particle port of the Adafruit_ILI9341 library already has an internal reference to Adafruit_mfGFX (see here) hence you shoudn’t import Adafruit_GFX.
When you remove the library and the respective include statement from your project it should compile.
Perfect. Thank you for your quick replies and accurate questioning. Thumbs up!
Just to round things up, here’s the “detailed” fixing procedure:
Remove the “Adafruit_GFX” library from the app
Remove the include Adafruit_GFX statement from the code
For further understanding: Whenever a library is imported I should check it’s property file to prevent double references. Is this actually good practice?
If the library itself does not state that it depends on any other library then importing the library alone should suffice.
If it doesn’t state the fact but still would require the user to import another lib then this can be considered poor practice and should be addressed via a GitHub issue on the library repo.
Tutorials tend to get out of date and hence should not be taken without double checking whether or not things have changed since.
The primary source of information should be the tools the tutorial is based on.