title: Is it possible to avoid C++ compiler error (C2757) where 2 different header files contain same symbol for namespace & class?
body: <p>I am facing a problem when implementing some new code to an existing library. This library already references a class with a name say '<strong>foo</strong>'. The same name is used as a namespace in the other header file which has to be included to implement the new functionality. Since both the header files are a part of legacy code libraries I cannot amend them. So here I am looking for any way so as to avoid the Compiler Error (C2757: <em>a symbol with this name already exists and therefore this name cannot be used as a namespace name</em>). I am not sure whether it is possible or not. Hence, Any help shall be appreciated. Thanks</p>
  
  <p>For clarity here is the sample code illustration for the issue:</p>
  
  <p>HeaderA.h</p>
  
  <pre><code>class foo
  {}
  </code></pre>
  
  <p>HeaderB.h</p>
  
  <pre><code>namespace foo
  {
  class ABC{}
  }
  </code></pre>
  
  <p>HeaderC.h</p>
  
  <pre><code>#include &lt;HeaderA.h&gt;
  #include &lt;HeaderB.h&gt;
  using namespace foo;
  
  class Toimplement{
  ABC a; //Throws Error C2757
  }
  </code></pre>