kodlab::CTRL_C_DETECTED is defined as a static, gobal variable in common_header.h. As such, it is restircted to the scope of the file in wihch it is defined (i.e., it is not available externally to other translation units), and cannot be used in cpp files other than that where then main method is defined. I am sure access to this variable should not be restricted to header files.
Expected Behavior
kodlab::CTRL_C_DETECTED is accessible globally in all source cpp files.
Current Behavior
kodlab::CTRL_C_DETECTED is only available in the same translation unit as the main method (i.e., not in any other source cpp files).
Proposed Solutions
kodlab::CTRL_C_DETECTED should be declared as a non-static, extern in common_header.h and defined in some common header implementation file (as done at the top of this answer).
We should provide more clear methods for setting and reading kodlab::CTRL_C_DETECTED.
kodlab::CTRL_C_DETECTED
is defined as a static, gobal variable incommon_header.h
. As such, it is restircted to the scope of the file in wihch it is defined (i.e., it is not available externally to other translation units), and cannot be used incpp
files other than that where then main method is defined. I am sure access to this variable should not be restricted to header files.Expected Behavior
kodlab::CTRL_C_DETECTED
is accessible globally in all sourcecpp
files.Current Behavior
kodlab::CTRL_C_DETECTED
is only available in the same translation unit as the main method (i.e., not in any other sourcecpp
files).Proposed Solutions
kodlab::CTRL_C_DETECTED
should be declared as a non-static,extern
incommon_header.h
and defined in some common header implementation file (as done at the top of this answer).kodlab::CTRL_C_DETECTED
.