1
votes

I've created an Arduino project using the "Adafruit_SSD1306" display library, which works as expected using a Uno board.

A subsequent project needed to use the ESP8266 wifi board, which required a new display library "ESP_SSD1306". I can see from the source this library is derived from the "Adafruit_SSD1306". Everything compiles and works as expected.

However, if I go back and try to rebuild my old project, or any old project, sample etc that references "Adafruit_SSD1306", it will not build, unless I remove the "ESP_SSD1306" library from my "libraries" folder.

The error is:

sketch_aug04b_xxxxxxx.ino:24:30: fatal error: Adafruit_SSD1306.h: No such file or directory compilation terminated. Error compiling.

The workaround is to add or remove this library from the libraries folder whenever I switch to non-ESP8266 project and manually add it back when I switch to an ESP8266-based project.

I'm guessing the libraries conflict in some way, but I am hoping there is a better user experience for dealing with this. Some #define or project setting I can use to remove a library from the compilation path (other then the current process, which involves manually removing the library).

1

1 Answers

1
votes

Looks like I've found the answer.

Both libraries have the identical name in their library.properties file. This appears to be what is causing the conflict.

The solution was to change the name property of the ESP_SSD1306 library from "Adafruit SSD1306" to "ESP SSD1306":

name=ESP SSD1306 version=1.0.0 author=Adafruit maintainer=Adafruit sentence=SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs! paragraph=SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs! category=Display url=https://github.com/adafruit/Adafruit_SSD1306 architectures=*