title: Conditional Compile of const static arrays
body: <p>I am trying to create an error enum and associated text descriptors aligned in the same file.  I have a system.cpp file that contains the following:</p>
  
  <pre><code>#define SYSTEMCODE
  #include "myerrors.h"
  </code></pre>
  
  <p>The file myerrors.h contains:</p>
  
  <pre><code>typedef enum errors {
      OK,
      BADERROR,
      LASTENUM  } ERR;
  #ifndef SYSTEMCODE
  extern char const *_errtext[];
  #else
  const char * _errtext[ERR::LASTENUM +1] = {
      "OK",
      "BADERROR",
      "LASTENUM"   };
  #undef SYSTEMCODE
  #endif
  </code></pre>
  
  <p>I include system.h in all sources that need error services and they do not define SYSTEMCODE.</p>
  
  <p>I expect that only the system.cpp file will compile the text array and all others will simply have an extern reference.  The system.cpp object does not have the _errtext array thus causing a link error.  I disable pre-compiled headers and I have tried many variations of this. MSDEV does not get it right.</p>
  
  <p>Any ideas?</p>