This technique of breaking up code into manageable sub files works fine on other compilers such as the ICC AVR. The button_map is only defined here but Arduino thinks otherwise. The C struct format is also proven good in other compilers. The code below is a condensed .c sub file in the same directory as the .uno file and is included in the base .c file.
C:\Users\adelle\AppData\Local\Temp\2\arduino\sketches\861ADAE8B471FB914FD4E33F84F9371D\sketch\mstr_clk_buttons.c.o (symbol from plugin): In function button_map': (.text+0x0): multiple definition of
button_map'
C:\Users\adelle\AppData\Local\Temp\2\arduino\sketches\861ADAE8B471FB914FD4E33F84F9371D\sketch\andy_TFT.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
32 posts - 5 participants