yoprogramo / QRcodeDisplay

ESP Generate QRCode for several displays - Base Repo
19 stars 10 forks source link

not able to compile for esp32 dev module #3

Closed caster1 closed 2 years ago

caster1 commented 2 years ago

hi its being compiled for esp32c3 and s2 but not dev module her is the error log

C:\Users\dhara\OneDrive\Documents\G drive\Dharani\Arduino\libraries\QRcodeOled-master\src/qrcodeoled.h:16:1: error: expected class-name before '{' token
 {
 ^
Using library QRcodeOled-master at version 1.0.0 in folder: C:\Users\dhara\OneDrive\Documents\G drive\Dharani\Arduino\libraries\QRcodeOled-master 
Using library esp8266-oled-ssd1306-master at version 4.2.1 in folder: C:\Users\dhara\OneDrive\Documents\G drive\Dharani\Arduino\libraries\esp8266-oled-ssd1306-master 
Using library Wire at version 2.0.0 in folder: C:\Users\dhara\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\libraries\Wire 
Using library QRcodeDisplay-master at version 1.0.0 in folder: C:\Users\dhara\OneDrive\Documents\G drive\Dharani\Arduino\libraries\QRcodeDisplay-master 
exit status 1
Error compiling for board ESP32 Dev Module.

here is the code

/* *********************************************************************************
 * ESP8266 QRcode
 * dependency library :
 *   ESP8266 Oled Driver for SSD1306 display by Daniel Eichborn, Fabrice Weinberg
 *
 * SDA --> D6
 * SCL --> D7
***********************************************************************************/
#define OLEDDISPLAY

#include <qrcodeoled.h>
#include <SSD1306.h>

SSD1306  display(0x3c, 21, 22); // Only change

QRcodeOled qrcode (&display);

void setup() {

    Serial.begin(115200);
    Serial.println("");
    Serial.println("Starting...");

    display.init();
    display.clear();
    display.display();

    // enable debug qrcode
    // qrcode.debug();

    // Initialize QRcode display using library
    qrcode.init();
    // create qrcode
    qrcode.create("Hello world.");

}

void loop() { }
yoprogramo commented 2 years ago

It seems a circular definition, try putting #include "qrcode.h" in the code before including qrcodeoled

#include "qrcode.h"
#include <qrcodeoled.h>
#include <SSD1306.h>

...
caster1 commented 2 years ago

Screenshot (11) the same code is not compiling for esp32dev bpard but compiling for esp32c3 and s2

Screenshot (12)

yoprogramo commented 2 years ago

Do you have another library than have qrcode.h that can interfere with the compilation?

yoprogramo commented 2 years ago

Test the 2.0.0 version, please, the qrcode.h has been renamed to qrcodedisplay.h to avoid conflicts

yoprogramo commented 2 years ago

Did you manage it to work? I have to close this issue...