2023-03-06 07:07 AM
I am trying to implement dynamic QRCode generation. I am using the library https://github.com/ricmoo/QRCode and the QRCode widget from https://support.touchgfx.com/4.16/docs/development/ui-development/touchgfx-engine-features/custom-widgets#example-source-code.
The qrcode generation library is in C and uses variable length arrays. TouchGFX, which uses C++ compiler, does not like this and throughs error.
How do I inform TouchGFX tool to treat the library as C files? The C library does have extern C used as below. But it still doesn't help.
#ifdef __cplusplus
extern "C"{
#endif /* __cplusplus */
For your reference, I am attaching the TouchGFX project here.
2023-03-07 08:21 AM
Hi @BGuth.1
The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.
Regards,
Billy
2023-03-08 11:45 AM
you should tell you compiler that it should compile this file as c code. this has nothing to do with touchgfx directly, it is a compiler/IDE setting. what toolchain are you using?
or
the lib says
The version of a QR code is a number between 1 and 40 (inclusive)
uint8_t alignCount = version / 7 + 2;
.
.
.
uint8_t alignPosition[alignCount];
so you could calc the size manually. but this i would only do for testing as it is no sustainable way(every update of the lib will break your code)
or you try another lib like https://github.com/nayuki/QR-Code-generator ?
2023-03-08 05:37 PM
2023-03-08 05:59 PM