title: Use variable across multiple Cpp files
body: <p>Have searched enough answers but none of the solutions work for me.</p>
  
  <p>scenario :
  I am trying to include a .h file that has some functions declared (not defined) and some variables declared.</p>
  
  <p>If I include this header file in the source files (2 to be precise) that actually use the functions and variables, then the last one that compiles has a linker error that states </p>
  
  <blockquote>
    <p>undefined reference to `abc::myfun(char const*, char const*, char*)'</p>
  </blockquote>
  
  <p>All the functions and variables in the header files have been declared as extern and include guards are present.</p>
  
  <p>I wish to have one cpp file put a value in the variable defined in the .h file and another cpp file to be able to read it.</p>
  
  <p>Also if it helps, every piece of my code is in a namespace that I have defined ( <code>namespace abc{ //all my code, in all the files }</code> )</p>