If I have a global variable that is defined as staticbool MyLabel;, how would I add it to a header so that it can be accessed by multiple files?
Normally I would use the extern keyword in the header, but that doesn't work in combination with static as it gives the following errors in VS2008:
MyFile.h(###) : error C2159: more than one storage class specified
MyFile.cpp(###) : warning C4211: nonstandard extension used : redefined extern to static
Background:
I have a file of 15,000 lines (written in a c-style) with hundreds of global variables that I am tasked with cleaning up. I've decided that my first step will be separating this monster into several files of a manageable size. I will remove the need for global variables later.