I have a global variable:
const std::string whiteSpaceBeforeLeadingCmntOption = "WhiteSpaceBeforeLeadingComment";
When I remove the const on this variable declaration, I get many occurrences of the following linker error:
error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > whiteSpaceBeforeLeadingCmntOption" (?whiteSpaceBeforeLeadingCmntOption@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in REGISTER_TO_UNSRLZ.obj
This is in a .h file, which is included various places, but I have a #ifndef band on it to avoid including it in several places. Any ideas what the error is from?