Dear team,
One of my customers is using their customized library.
In this library, they defined a structure in Define.h:
Then a structure is declared in a c file in the library:
The library can be built successfully with no error.
Then the library is included in the project. Since they still want to use the cputoclaRegs in the project(other .c not included in the lib), they defined the structure again in another Init_CLA.h file.
And declared in a c file:
The following error shows up:
symbol "_cputoclaRegs" redefined: first defined in "../lib/ME1500D0U211-Arith-cla.lib<ConstTab_J.obj>"; redefined in "../lib/ME1500D0U211-Arith-cla.lib<Svpwm_J.obj>" symbol "_cputoclaRegs" redefined: first defined in "../lib/ME1500D0U211-Arith-cla.lib<ConstTab_J.obj>"; redefined in "../lib/ME1500D0U211-Arith-cla.lib<Svpwm_J.obj>"
It seems cputoclaRegs is indeed defined twice both in library and out of library. However, if we really need to use cputoclaRegs in the main c files, we have to declare it again. Is there any method we can avoid this problem? Did we code in a right way?
Thanks!



