blynkkk / blynk_Issues

6 stars 6 forks source link

class BlynkConsole' has no member named 'init #231

Open ankitjha2263 opened 1 year ago

ankitjha2263 commented 1 year ago

Console.h:8:17: error: 'class BlynkConsole' has no member named 'init'

8 |   edgentConsole.init(BLYNK_PRINT);

  |                 ^~~~

exit status 1

'class BlynkConsole' has no member named 'init'

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

OliverD59 commented 1 year ago

I have just had the same error report on a file which previously compiled correctly.

Verbose output is

In file included from C:\Users\Oliver\Documents\Arduino\ESP8266CornerHouseCHHW\BlynkEdgent.h:25:0, from C:\Users\Oliver\Documents\Arduino\ESP8266CornerHouseCHHW\ESP8266CornerHouseCHHW.ino:53: C:\Users\Oliver\Documents\Arduino\ESP8266CornerHouseCHHW\Console.h: In function 'void console_init()': Console.h:8:17: error: 'class BlynkConsole' has no member named 'init' edgentConsole.init(BLYNK_PRINT);

Does anyone have a solution please?

Void12987 commented 1 year ago

This is because one of the later versions of Blynk, installed via the Arduino Library Manager, calls a renamed function within BlynkEdgent, which is manually added into your project.

The way I fixed it was delete your Edgent folder, go to Arduino > Examples > Blynk > Blynk.Edgent > Edgent_ESP32 (or 8266 or which board you are using), copy that folder into your project. It should compile with edgentConsole.begin instead of init().

OliverD59 commented 1 year ago

This is because one of the later versions of Blynk, installed via the Arduino Library Manager, calls a renamed function within BlynkEdgent, which is manually added into your project.

The way I fixed it was delete your Edgent folder, go to Arduino > Examples > Blynk > Blynk.Edgent > Edgent_ESP32 (or 8266 or which board you are using), copy that folder into your project. It should compile with edgentConsole.begin instead of init().

Many thanks for this. Without realising exactly what the problem was I did exactly as you described and it sorted the error. Now at least I know how to avoid again.
Thanks.