datasith / Ai_Ardulib_SSD1306

Library for using SSD1306-powered OLED displays in the Arduino IDE.
MIT License
56 stars 22 forks source link

error: default argument given for parameter 2 of 'void ACROBOTIC_SSD1306 #13

Open superpance opened 5 years ago

superpance commented 5 years ago

Hello, Trying to test the screen with a simple script and the nodemecu board I get this error in the Arduino Ide

xxxxxxxx\ACROBOTIC_SSD1306.cpp:58:72: error: default argument given for parameter 2 of 'void ACROBOTIC_SSD1306::setFont(const uint8_t*, bool)' [-fpermissive]

void ACROBOTIC_SSD1306::setFont(const uint8_t* font, bool inverse=false)

                                                                    ^

xxxxxxxx\ACROBOTIC_SSD1306.h:120:10: error: after previous specification in 'void ACROBOTIC_SSD1306::setFont(const uint8_t*, bool)' [-fpermissive]

 void setFont(const uint8_t* font, bool inverse=false);

      ^

exit status 1 Error compiling for board NodeMCU 1.0 (ESP-12E Module).

CutestNekoAqua commented 4 years ago

same here with Esp32

TimoLehnertz commented 4 years ago

Hey there, Quite late but maby someone else can benefit from what i found. So i am using Visual studio Code with platformio and have exactly the same error. I couldnt figure out exactly why it apears but if you just remove that bool inverse=false from both the .cpp and .h files, it should compile. You will not be able to set this property easily but who wants reverset Font.

vfkomarov commented 3 years ago

Hello, i am using VS Code with PlatformIO just got exactly the same error when i moved my own function ended with exactly same default falue "(..., boolean reverse = false)" from main.cpp to a separate included file .h/cpp

Upd: It is no matter how type default argument has.