In C file
// f1.c
const uint8_t C_VAL=2;`
In C++ file I declare simple array
// f2.cpp
extern "C" const uint8_t C_VAL;
char charray[C_VAL];
Build output:
#259: constant value is not known
There was not any errors when I link extern in .C
// f2.c
extern const uint8_t C_VAL;
char charray[C_VAL];
Works fine.
Seems the problem is with linkage. Is it possible to fix, how? Is this problem only in MDK-ARM or other compilers have too?