Multiple Adafruit GFX, how load the right one?

zoomx
Wed Sep 09, 2015 10:44 am
I just got an SPI ILI9341 TFT LCD so I wanted to try the STM32-O-Scope modified by ahull.

I am using Arduino IDE 1.6.5r5 and the last STM32 core downloaded today.

When compiling I get this error “class Adafruit_ILI9341_STM’ has no member named ‘width'” and many others all related to the same class that has no membres print, setCursor, etc.

I have the Adafruit_GFX_AS library in the library folder and there is another one in the F1 folder of the STM32duino core. Unfortunately the compiler get the first one.

They are almost equal but the error came from this:
The first one has these define
#ifndef _ADAFRUIT_GFX_AS_H
#define _ADAFRUIT_GFX_AS_H


mrburnette
Wed Sep 09, 2015 12:21 pm
zoomx wrote:I just got an SPI ILI9341 TFT LCD so I wanted to try the STM32-O-Scope modified by ahull.

I am using Arduino IDE 1.6.5r5 and the last STM32 core downloaded today.

When compiling I get this error “class Adafruit_ILI9341_STM’ has no member named ‘width'” and many others all related to the same class that has no membres print, setCursor, etc.

I have the Adafruit_GFX_AS library in the library folder and there is anoter one in the F1 folder of the STM32duino core. Unfortunately the compiler get the first one. <…>


zoomx
Wed Sep 09, 2015 2:02 pm
These can be solution 4 and 5.

But in this case I will have to modify all sketches that use it and remember of that modification in all published sketches. Furthermore I have to remember to modify it every time I update the core and to modify every library that use it.
This library is very common when using displays.

Anyway I copied all GFX library in the sketch folder and changed #include “Adafruit_GFX_AS.h” to #include ‘Adafruit_GFX_AS.h’, it works on Windows.
But didn’t work because of the other referincing inside Adafruit_ILI9341_STM.h, I get
fatal error: Adafruit_GFX_AS.h: No such file or directory
#include <Adafruit_GFX_AS.h>


mrburnette
Wed Sep 09, 2015 8:27 pm
zoomx wrote:
<…>
But in this case I will have to modify all sketches that use it and remember of that modification in all published sketches. Furthermore I have to remember to modify it every time I update the core and to modify every library that use it.
This library is very common when using displays.

Anyway I copied all GFX library in the sketch folder and changed #include “Adafruit_GFX_AS.h” to #include ‘Adafruit_GFX_AS.h’, it works on Windows.
But didn’t work because of the other referincing inside Adafruit_ILI9341_STM.h, I get
fatal error: Adafruit_GFX_AS.h: No such file or directory
#include <Adafruit_GFX_AS.h>


madias
Wed Sep 09, 2015 9:42 pm

fatal error: Adafruit_GFX_AS.h: No such file or directory
#include <Adafruit_GFX_AS.h>

try it with
#include "Adafruit_GFX_AS.h"


zoomx
Thu Sep 10, 2015 6:36 am
Thanks madias,
I have already made it.

The Time.h error was due to the same problems: names conflict.

As Victor wrote here
viewtopic.php?f=19&t=107&hilit=RTClock&start=130#p4302
in Windows I must rename Time.h in other name. I choose TimePaulStoffregen.h, it is more longer but it is simple to understand that it is the time library written by Paul Stoffregen. Paul didn’t write any credits inside any file .h or cpp.

Now everiting compile, it’s time to use wires and connect the TFT.

The strange thing is that i searched for time.h and windows din’t find any file.

It works!


martinayotte
Thu Sep 10, 2015 2:25 pm
zoomx wrote:The strange thing is that i searched for time.h and windows din’t find any file.

mrburnette
Thu Sep 10, 2015 11:47 pm
zoomx wrote:
<…>
It works!

RogerClark
Sun Sep 13, 2015 4:59 am

These things take time to mature – 365 days ago, the Leaflabs core had not been rewritten for the shipping Arduino IDE. We have come a long way.

I should have keep an eye on the dates.

I just checked the original posting on Arduino.cc about the cheap maple mini clones and its dated 9th Sept !

So just over a year ago, but at that time Bob C has not ported libmaple to work as a third party core


zoomx
Wed Mar 16, 2016 2:01 pm
I post again here because I got the same problem with an ESP8266 sketch and Arduino 1.6.5 IDE choose to take the Arduino library instead the ESP8266 one that is in its core.
I used the full windows path inside <>, got no errors. It is not a solution since you have to change path every time you move the code. It’s a very dirty patch.

The library is WiFiClient.h that is part of ESP8266WiFi library: 71 files so it is a little impractical to add all of them to the sketch folder.

The new is that with this dirty dirty trick you can choose which library the IDE must use.


zmemw16
Wed Mar 16, 2016 2:21 pm
istr doesn’t the ide catalogs the libraries it’s found at some point and which one it’ll use, maybe from setting verbose compiling messages?

how you change the include and library search paths is another question.

srp


zoomx
Thu Mar 17, 2016 4:59 pm
When you compile the IDE tells which library it will use in case of different libraries with the same name. You don’t need to set to verbose.

I didn’t find any other way to tell the IDE to use a specific library instead of absolute path.

If you use few libraries with few files you can put them in the sketch folder, it’s more elegant. But my case was a lot of files, 71.


mrburnette
Thu Mar 17, 2016 9:01 pm
zoomx wrote:
<…>
If you use few libraries with few files you can put them in the sketch folder, it’s more elegant. But my case was a lot of files, 71.

Leave a Reply

Your email address will not be published. Required fields are marked *