Undefined reference to 'app'

I have been following the “Porting EVK1000 to ST System Workbench” manual(https://forum.qorvo.com/uploads/default/original/1X/cf751b37b1b9c94fc530ce3043b5aea704830d22.pdf).

When following the step “4. PORTING EVK APPLICATION INTO SYSTEM WORKBENCH IDE”, I’m getting this “undefined reference to ‘app’” error.

These are the paths I included.
The function flush_report_buff() is in /platform/port.h and deca_usb.h includes port.h.
Could someone give a clue what include or linker configurations are not done properly?

Nevermind. I just added “app_t app;” line into main.c and it works.

Hello dwacky!

Where and how did you add app_t app in main?

Best regards


@jludvig I declared it as a global variable int the main.c file and it worked. Put it below the include lines and it probably will work.