Hi,
I'm new in programming with codewarrior.
I'm refactoring some code written by someone else for the Freescale
MC56F8013 .
I'm moving some function (that I'll use for other project) from the
main.c to another file (modbus.c). For the occasion I've created a
modbus.h which contains the functions prototypes and some global
variables that I need in the main.c file (and in some isr functions, so
I can't make them local).
In the modbus.h I've setted the:
#ifndef _MODBUS_
#define MODBUS_
UInt16 rx_cnt;
#endif
so there should not be any duplicate of the variables.
The problem is that when I link there is this error:
Link Error : Multiply-defined: "Frx_cnt" in main.c
Previously defined in modbus.c
Any idea why there is this error and how to solve it?
Thanks Jack