olikraus / U8glib_Arduino

U8glib library for Arduino
Other
161 stars 84 forks source link

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

Open djmitho opened 4 years ago

djmitho commented 4 years ago

On the example U8GLib.ino is not possible to compile. Error on line 142: const colorDef 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 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 commented 4 years ago

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 commented 4 years ago

I am sorry about that I will try today to change that in the program Thank you

El lun., 22 jun. 2020 22:09, olikraus notifications@github.com escribió:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/olikraus/U8glib_Arduino/issues/24#issuecomment-647744379, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBAM5A2LDVOJ3KQJOGVXPLRX63BLANCNFSM4OEAJF6A .

djmitho commented 4 years ago

Hello again With U8G2 library i get the same error compilation Do you know how to solve this problem? Is with the example included on library "ArduinoMenu" called U8G2

C:....\Arduino\libraries\ArduinoMenu-master\src/menuIO/u8g2Out.h: In function 'global constructors keyed to 65535_0_U8G2.ino.cpp.o': U8G2:80:25: error: variable 'colors' with dynamic initialization put into program memory area const colorDef 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

Thank you in advance

El mié., 24 jun. 2020 a las 6:55, Rafael Angel (djmitho@gmail.com) escribió:

I am sorry about that I will try today to change that in the program Thank you

El lun., 22 jun. 2020 22:09, olikraus notifications@github.com escribió:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/olikraus/U8glib_Arduino/issues/24#issuecomment-647744379, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBAM5A2LDVOJ3KQJOGVXPLRX63BLANCNFSM4OEAJF6A .

olikraus commented 4 years ago

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

djmitho commented 4 years ago

ok thanks

El sáb., 27 jun. 2020 a las 0:55, olikraus (notifications@github.com) escribió:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/olikraus/U8glib_Arduino/issues/24#issuecomment-650438846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBAM5GEF4JMIPPIM4RQKVDRYURNTANCNFSM4OEAJF6A .

haklein commented 2 years ago

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 };