c - Uninitialized variable put into program memory area. AVR programming -


in xxx.h file have declaration:

const struct menuitem menuitema; 

in xxx.c file have definition:

const struct menuitem menuitema progmem = {texta, menuitemafunction, &menuitemb, 0}; 

i include xxx.h file in main.c file. while building project warning:

uninitialized variable 'menuitema' put program memory area [-wuninitialized]

when had declaration , definition in same .c file ok, have no idea wrong now.

joachim correct, definitions in header files need extern - otherwise every time use header (in different source file) you'll create copy of variable. answer original question, suspect variable in code section because constant, if remove const it'll go bss or data section depending on how it's defined. you're main problem lack of extern


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -