title: Xcode showing "Use of undeclared Identifier" error for C++ inheritance
body: <p>I am getting this error "Use of undeclared Identifier "Main" in Xcode when I try to inherit a class. I am unable to find out why this error is showing up. Please someone help.</p>
  
  <p>My sample code which is failing in Xcode. <strong>foo</strong> is the base class</p>
  
  <p><strong>foo.h</strong></p>
  
  <pre><code>#ifndef cpp_practice_foo_h
  #define cpp_practice_foo_h
  class Foo {
  public:
      void fooFunc();
  };
  
  
  #endif
  </code></pre>
  
  <p><strong>foo.cpp</strong></p>
  
  <pre><code>#include "foo.h"
  #include&lt;iostream&gt;
  
  using namespace std;
  
  void Foo::fooFunc() {
      cout&lt;&lt; "Hola from Foo!" &lt;&lt; endl;
  }
  </code></pre>
  
  <p><strong>main.h</strong></p>
  
  <pre><code>#ifndef cpp_practice_main_h
  #define cpp_practice_main_h
  #include "foo.h"
  class Main :: public Foo
  {
  public:
      void mainFunc();
  
  };
  #endif
  </code></pre>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "main.h"
  using namespace std;
  
  void Main::mainFunc() {
      cout&lt;&lt; "Hola from Boo" &lt;&lt; endl;
  }
  
  int main(int argc, const char * argv[])
  {
      return 0;
  }
  </code></pre>
  
  <p>The line below in main.h is where the error is showing up.</p>
  
  <p><strong>class Main :: public Foo</strong> </p>