2013-10-02 09:14 AM
Hi,
I just cannot understand what I'm doing wrong... I have :in main.c :
static volatile uint32_t TimingDelay;
in main.h :
#ifndef __MAIN_H
#define __MAIN_H
extern uint32_t TimingDelay;
#endif
and I use this variable in cube.c:
#include ''main.h''
void Delay(__IO uint32_t nTime) {
TimingDelay = nTime;
while(TimingDelay != 0);
}
When I build project I get link error :
Error[Li005]: no definition for ''TimingDelay'' [referenced from J:\My Documents\Delovni\Cubesensors\Cube\IAR\STM32F0-Discovery_FW_V1.0.0\Project\Peripheral_Examples\Cubesensor\
EWARM\EXTI\Obj\cube.o]
Error while running Linker
Why doesn't function in cube.c see that variable ?
Thanks in advance,
regards,
Bulek.
#iar-link-problem #know-your-tools
2013-10-02 09:23 AM
Because ''static'' infers the variable is not visible outside of main.o?
2013-10-02 09:34 AM
Shame on me...
Thanks for help, regards...