I am working in a MFC project and i have a header and cpp file of my library, i include header file in different files but include cpp in only "main" file. i have a global initialization of a char array in the header file because all the files need it. But when i compile it, understandably, it tells me that i have initialized the char array twice.
I Tried using pragma once and the defining trick used in header files
#ifndef MY_HEADER_FILE
#define MY_HEADER_FILE
//Initialization here
#endif
But the linker still gives error, how do we solve this issue?