Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error variable 'colors' with dynamic initialization put into program memory area #24

Open
djmitho opened this issue Jun 21, 2020 · 6 comments

Comments

@djmitho
Copy link

djmitho commented Jun 21, 2020

On the example U8GLib.ino is not possible to compile.
Error on line 142: const colorDef<uint8_t> colors[] MEMMODE={

full error of compiler is:

src/menuIO/U8GLibOut.h: In function 'global constructors keyed to 65535_0_U8GLib.ino.cpp.o':
U8GLib:142:25: error: variable 'colors' with dynamic initialization put into program memory area
const colorDef<uint8_t> colors[] MEMMODE={
^
lto-wrapper.exe: fatal error: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
exit status 1
variable 'colors' with dynamic initialization put into program memory area

Arduino version 1.8.13
Any idea?

@olikraus
Copy link
Owner

I think this is the wrong place to ask. U8gLibOut.h is not a file which was created inside this project.
Moreover U8glib is replaced by U8g2.

@djmitho
Copy link
Author

djmitho commented Jun 24, 2020 via email

@djmitho
Copy link
Author

djmitho commented Jun 24, 2020 via email

@olikraus
Copy link
Owner

Not sure what I can do here. I did not wrote the code. Better to ask the author of u8g2Out.h.

@djmitho
Copy link
Author

djmitho commented Jun 28, 2020 via email

@haklein
Copy link

haklein commented Aug 25, 2021

you can't use colors[] in later versions but would need something like this:
const colorDef<uint16_t> colors[6] MEMMODE = { {{(uint16_t)BLACK, (uint16_t)WHITE}, {(uint16_t)BLACK, (uint16_t)WHITE, (uint16_t)WHITE}}, //bgColor {{(uint16_t)WHITE, (uint16_t)BLACK}, {(uint16_t)WHITE, (uint16_t)BLACK, (uint16_t)BLACK}}, //fgColor {{(uint16_t)WHITE, (uint16_t)BLACK}, {(uint16_t)WHITE, (uint16_t)BLACK, (uint16_t)BLACK}}, //valColor {{(uint16_t)WHITE, (uint16_t)BLACK}, {(uint16_t)WHITE, (uint16_t)BLACK, (uint16_t)BLACK}}, //unitColor {{(uint16_t)WHITE, (uint16_t)BLACK}, {(uint16_t)BLACK, (uint16_t)BLACK, (uint16_t)BLACK}}, //cursorColor {{(uint16_t)BLACK, (uint16_t)WHITE}, {(uint16_t)WHITE, (uint16_t)BLACK, (uint16_t)BLACK}}, //titleColor };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants