title: Compiling with Extern variable in C++
body: <p>I have a header file : headerFiles.h containing following extern variable :</p>
  
  <pre><code>extern char *err_msg;
  extern char recvbuf[DEFAULT_BUFLEN];
  extern char sendbuf[DEFAULT_BUFLEN]; 
  </code></pre>
  
  <p>this header file is included into : Helper.h and Helper.h is included into Helper.cpp, So,</p>
  
  <p><strong>headerFiles.h</strong> --> included in --> <strong>Helper.h</strong> --> included in --> <strong>Helper.cpp</strong></p>
  
  <p>but when I am referencing the extern variables in my Helper.cpp file the compiler is giving following linking error :</p>
  
  <blockquote>
    <p>Error LNK2001 unresolved external symbol "char * err_msg"
    (?err_msg@@3PADA)</p>
  </blockquote>
  
  <p>I think it can be compiled via command line, but I want to know how to compile it using Visual C++. I have VC++ 2017 Community edition.
  Please help.  </p>