When I include the file "File_Config.h" in any of my .CPP files I get the following error:
File_Config.h(279): warning: #368-D: class "<unnamed>" defines no constructor to initialize the following: const member "<unnamed>::DrvCfg" typedef struct { ^
Why does it need a constructor when the structure is surrounded by #ifdef __cplusplus extern "C" { #endif
Thanks.
You are compiling C++, not C. So why shouldn't the compiler use C++ warnings?
Because the structure is surrounded by:
#ifdef __cplusplus extern "C" { #endif Structure Here #ifdef __cplusplus } #endif
This should cause the compiler to compile everything (functions/variables) within the braces as "C" code.
"This should cause the compiler to compile everything (functions/variables) within the braces as "C" code."
Are you willing to bet money that you have correctly understood the meaning of extern "C"? An hint here, is that the compiler have a different view than you - and the compiler is most times correct...