QRCode
QRCode copied to clipboard
error: 'QRCode' was not declared in this scope
wondering what I am doing wrong, I am attempting to compile the example in my Arduino UI
https://github.com/ricmoo/QRCode/blob/master/examples/QRCode/QRCode.ino
I have installed the library using the Library Manager...
also check that it is installed...
libraries$ ls -al
total 28
drwxrwxr-x 7 clay clay 4096 Nov 20 22:32 .
drwxrwxr-x 4 clay clay 4096 Nov 20 22:26 ..
drwxrwxr-x 4 clay clay 4096 Nov 20 19:10 Base64
drwxrwxr-x 4 clay clay 4096 Nov 20 19:10 Keypad
drwxrwxr-x 5 clay clay 4096 Nov 20 22:32 QRCode
drwxrwxr-x 9 clay clay 4096 Nov 20 19:10 TFT_eSPI
and when I try to compile the example,
/home/clay/data/github.com/ricmoo/QRCode/examples/QRCode/QRCode.ino: In function 'void setup()':
QRCode:21:5: error: 'QRCode' was not declared in this scope
QRCode qrcode;
^~~~~~
QRCode:22:24: error: 'qrcode_getBufferSize' was not declared in this scope
shouldn't it be able to find QRCode
? If it is inappropriate to post this here and its not a bug happy to close and move the conversation.
so I think I may know what the problem is, QRCode
as a directory name instead of all lower case qrcode
to match the import may be an issue with my version of the compiler finding the import of qrcode.h
.
@claytantor did you find a way to fix this? I am getting the same error
The problem for me was that the ESP32 board package also has a qrcode.h
. You can get around it by renaming this library's header (and so also the includes in src/qrcode.c
and your code).
Really stupid mistake, but the circumnavigate works, thanks!
Worked for me also, renamed 'qrcode.h' and 'qrcode.c' to 'qrcode_gen.h' and 'qrcode_gen.c', then also tweaked the 'include' line in qrcode.c.