Skip to main content
youssef.amimi
Associate II
July 18, 2019
Question

Linker error : no definition for "DATA"(variable of type struct data_t)

  • July 18, 2019
  • 2 replies
  • 4581 views

I have declared a typedef struct data_t on my jsmn.h

0690X000009Yt5TQAS.pngafter that I declared a variable DATA of type data_t on jsmn.c

0690X000009Yt6cQAC.png

and i defined N,T,C and H

0690X000009Yt6wQAC.png

then i declared DATA of type Data_t as extern on ScreenViewBase.cpp

0690X000009Yt7QQAS.png

and i try to display DATA.N on the screen

0690X000009Yt8OQAS.png

but a linker error appear : no definition for DATA referenced from ScreenViewBase.o

PS1: I do the same with time : in ScreenViewBase.cpp I declared extern RTC_TimeTypeDef sTime then  I write Unicode::snprintf(Ndata, 6, "%02d",sTime.Hours ); and it work perfectly.

PS2: I work with stm32f769 and with IAR 8.32.3

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
July 18, 2019

Perhaps because DATA isn't very original, and is used as a variable or section name within the namespace of the project, or associated libraries.

Pick something more unique...

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
youssef.amimi
Associate II
July 18, 2019

Hi @Community member​ 

I tried that(I replaced with youssef_data) but steel the same problem

Tesla DeLorean
Guru
July 18, 2019

Are we sure this is a linker error?

Post a build log, saves playing guess what's wrong.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
youssef.amimi
Associate II
July 18, 2019

this is a screenshot of the build log

0690X000009YtKPQA0.png