Web Editor Bug: no matching function for call to 'Adafruit_SSD1306

Do the Web Editor People fix the Examples?

ADAFRUIT SSD1306 Library
The Examples do not verify, specifically ssd1306_128X32_spi

https://create.arduino.cc/example/library/adafruit_ssd1306_2_2_1/adafruit_ssd1306_2_2_1\examples\ssd1306_128x32_spi/ssd1306_128x32_spi/preview

The Error:
/tmp/964409967/ssd1306_128x32_spi/ssd1306_128x32_spi.ino:36:52: error: no matching function for call to ‘Adafruit_SSD1306::Adafruit_SSD1306(int, int, int, int, int, int, int)’

log.txt (16.4 KB)

You need to talk to Adafruit for thier libraries and examples seek them out on Github.

The peeps in the backroom at Arduino already have thier hands full without having to fix somebody else's problems.

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Then you will know how to post links and sketches etc.

I guess I'll just ask for my $ back from Arduino for the Web Editor

That is your option.

But you cannot expect them to fix things outside thier control.
Sort of like asking Ford to fix your Maytag washing machine :grin:

I think you got it all wrong. I see it the other way around. Arduino provides the service. Adafruit didn't develop the Web Editor. Adafruit collects no funds from this paid service. Its not adafruits responsibility. it's the folks that provide the service and collect the $$.

But it is the Adafruit library and its example sketches you seem to be having the problem with.

Does the web editor compile and upload other sketches or is it just these particular examples from one particular library ?

If it is a problem with almost any sketch you pick then yes you need help sorting that out
And for that we would need a few more details.

Board type ?
OS and BROWSER versions ?
List of any additional security being used ?

And a few more that are mentioned in the sticky posts at the top of this forum section.

It's the untouched Adafruit example in the Arduino Web Editor.
It fails on the Arduino Web Editor
It works fine on the Arduino IDE

Therefore it's the design of the Arduino Web Editor which creates the issues.

Arduino Yun
Windows 10
Firefox

Everything else I've done in the Web Editor works fine.

Now I know a bit more about it I will push this post to the team on Monday.

The web editor allows you to select the versions of the library.
You may want to check which version it is until I can get some advice.
Maybe change the version you are calling.

As you guessed, this is not a bug with the "Adafruit SSD1306" library.

It's also not a bug with the Arduino Web Editor.

Unlike the Arduino IDE, where you must install libraries on demand, all the thousands of libraries in the Arduino Library Manager index are pre-installed on Arduino Web Editor. This is very convenient, but it can also cause some occasional problems. The issue is that with so many libraries installed it's more likely that two libraries will have the same header filename. When this happens, the Arduino dependency resolution system tries to pick the correct library, but there's really no way for it to make the right pick every time. The Arduino IDE would have the same problem if you had the two conflicting libraries installed. That was the case here. If you scroll up in the console output, you'll see this 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_2_1

The library the sketch was written for is "Adafruit SSD1306", but the library the build system picked was "Adafruit SSD1306 WeMos Mini OLED".

The way to fix it is to influence the dependency resolution system to give priority to the "Adafruit SSD1306" library. There are a few ways you can do this. Note that you only need to do one of the following options, not all three. I'm explaining all the options because each has its own advantages. Although any of the three will work with this particular library, in other cases you will find that only the third option is possible:


The first option is to add an #include directive for a header file that's unique to the library you want before the ambiguous #include directive. In this case, there is a unique header file named splash.h. So you only need to add this line above the #include directive for Adafruit_SSD1306.h:

#include <splash.h>

This solution only works when the library has a header file with a unique name. To find that out for any future libraries you might have this problem with, you can download the library from Arduino Web Editor by hovering the mouse pointer over the library name in your "Favorites", clicking the downward pointing triangle to the right of the library name, then clicking "Download Library". Unzip the downloaded library, then take a look at the .h files that are either in the library's root folder or the src subfolder.


The second option is to use the Arduino Web Editor's sketch metadata system to associate the specific version of the library you want with the sketch:

  1. From the menu on the left side of the Arduino Web Editor window, click "Libraries".
  2. Click the Library Manager button.
  3. Search for "adafruit SSD1306".
  4. If the star to the right of the library is not already filled, click the star to add the library to your "Favorites".
  5. Click the Done button.
  6. From the Libraries pane of the Arduino Web Editor window, click the "Favorites" tab.
  7. Find "Adafruit SSD1306" in the list of favorite libraries and hover the mouse pointer over "Adafruit SSD1306".
  8. Click the downward pointing triangle on the right side of the Include button.
  9. Click "Version 2.2.1"

This will cause the sketch you had open at the time to always use version 2.2.1 of the "Adafruit SSD1306" library.

This is a sketch-specific association, so you need to repeat this process with each sketch you want to associate the library with.

You may want to occasionally check to see if Adafruit has released a new version of the library and repeat the process with the new version selected in order to take advantage of any improvements or bug fixes that have been made to the library in the new release.

This solution will only work for libraries that have had at least two releases. When there is only a single release, Arduino Web Editor doesn't give the option of associating a specific release with the sketch.


The third option is to import the library you want to use. Imported libraries are given preference over the pre-installed libraries.

  1. From the menu on the left side of the Arduino Web Editor window, click "Libraries".
  2. Click the Library Manager button.
  3. Search for "adafruit SSD1306".
  4. If the star to the right of the library is not already filled, click the star to add the library to your "Favorites".
  5. Click the Done button.
  6. From the Libraries pane of the Arduino Web Editor window, click the "Favorites" tab.
  7. Find "Adafruit SSD1306" in the list of favorite libraries and hover the mouse pointer over "Adafruit SSD1306".
  8. Click the downward pointing triangle to the right of "Adafruit SSD1306".
  9. Click "Download Library".
  10. Click the upward pointing arrow button ("Import") to the right side of the Library Manager button.
  11. If you get a popup about importing your sketchbook, click the Import button.
  12. Select the downloaded library (Adafruit_SSD1306-2.2.1.zip).
  13. Click the Open button.
  14. Wait for Arduino Web Editor to display the notification that the library was successfully imported.
  15. Click the OK button.

This will cause the version of the library you imported to always be used by all sketches (2.2.1 in this case), so you may want to occasionally check to see if Adafruit has released a new version of the library and repeat the process with the new version in order to take advantage of any improvements or bug fixes that have been made to the library in the new release.