Undefined reference to a variable

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undefined reference to a variable

1,067 Views
chaitanya
Contributor II

Hi,

I've been trying to port a code from kinetics Design Studio to MCU Xpresso. At a certain point, I've started seeing errors. These errors seem to be associated with Linker. 

c:/nxp/mcuxpressoide_11.1.1_3241/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.1.0.202001081728/tools/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: ./source/Module_Interrupt.o: in function `PORTB_IRQHandler':
C:\sam_ws_brian\sam_exec\PLS_DEBUG/../source/Module_Interrupt.c:416: undefined reference to `ModZOffset'
c:/nxp/mcuxpressoide_11.1.1_3241/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.1.0.202001081728/tools/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: ./source/Module_Interrupt.o: in function `MI_ProcessRDCinterrupt':
m_flash_config: 0 GB 16 B 0.00%

Can someone tell me what are these errors for and how to fix them?

Thanks

0 Kudos
Reply
1 Reply

976 Views
ErichStyger
Specialist I

I basically means that the linker cannot fine the symbol (variable?) ModZOffset.

Is this defined somewhere in your application?

If yes: is it static so it does not have external linkage?

Or is it present in a file but you have excluded it from build (see Exclude Source Files from Build in Eclipse | MCU on Eclipse )?

I hope this helps,

Erich