Maybe it is base knowledge, I am apologize.
I have a header file CTemp.h, with namespace CTemp:
namespace CTemp
{
bool bFlag;
};
#ifndef _CTEMP
#define _CTEMP
bool CTemp::bFlag = true;
#endif
and if I include CTemp.h to my cpp file and try to use CTemp::bFlag
bool bb = CTemp::bFlag;
the compiler throw error "redefinition"
I surely know, that I should to put initialization to a .cpp file, but I find some way, to solve it only with .h file. Because I don't want to add the .cpp file to my project. I thought, I could solve it with preprocessor directives #ifdef....
Thanks for advice.