Multiple libraries were found for "Adafruit_SSD1306.h"

There are two libraries containing the Adafruit_SSD1306.h header:

Trying to use the Adafruit SSD1306 library fails because by default the builder chooses the Adafruit SSD1306 Wemos Mini OLED library.

Even the example that comes with the Adafruit SSD1306 library doesn’t work. The builder issues an informative message:

Multiple libraries were found for “Adafruit_SSD1306.h”

Used: /home/builder/opt/libraries/latest/adafruit_ssd1306_wemos_mini_oled_1_1_2

Not used: /home/builder/opt/libraries/latest/adafruit_ssd1306_2_0_1

Maybe this message could be even improved by letting the user know how to choose the other one.

I found several topics discussing similar issues, and apparently it’s normal to have several libraries that have a header with the same file name. However, I didn’t find any instructions how to select which library to use in this case. The only workaround I came up with is to choose the version number 2.0.1 from the drop-down box when including the library, as the latest version of the Wemos Mini OLED library is 1.1.2. In other words:

// DOESN'T WORK

// Adafruit SSD1306 - Version: Latest 
#include <Adafruit_SSD1306.h>

// WORKS

// Adafruit SSD1306 - Version: 2.0.1
#include <Adafruit_SSD1306.h>

Did you mean

// DOESN'T WORK

// Adafruit SSD1306 - Version: Latest
#include <Adafruit_SSD1306.h>

// WORKS

// Adafruit SSD1306 - Version: 2.0.1
#include "Adafruit_SSD1306.h"

Use of the left/right arrows (angle brackets) ( < > ) and quotation ( " " )marks have two different actions.

Bob.

ballscrewbob:
Use of the left/right arrows (angle brackets) ( < > ) and quotation ( " " )marks have two different actions.

How does the Arduino builder handle differently include files that are between double quotation marks? For me the latter worked because the comment added by Arduino Web Editor advises the builder to choose version 2.0.1 that only exists for the original Adafruit SSD1306 library.

This article may help with that question.

As the IDE essentially compiles C it uses almost all the conventions of the C language.

I think there may be a little difference in that it selects between custom libs of your own or the built in rather than system paths.

Bob.

Thanks. It doesn't help in this case, though. I should have mentioned that I don't mean libraries that are installed "locally". I'm talking about using libraries that are available through the Library Manager, without installing them, just by #including them in the web editor.

In the case of the CREATE editor those conventions still apply.
It can use either the ones already selected or CUSTOM libs.

The Library manger ones when used count as LOCAL IIRC.

Bob.

tested the adafruit libs here and so did one of the team and we see issues too.

Possibly worth mentioning on Adafruit's GITHUB site.

Bob.