Function 'not declared in this scope', but it is! Isn't it?
<blockquote>
  <p>'initPhysics' was not declared in this scope.</p>
</blockquote>

<p>I have simplified my program as much as I could; here it is:</p>

<p>helloworld.hpp</p>

<pre><code>#ifndef HELLOWORLD_HPP
#define HELLOWORLD_HPP

class testWorld {
    public:
        testWorld() {}
        ~testWorld() {}
        void initPhysics();
};
#endif
</code></pre>

<p>hello.cpp</p>

<pre><code>#include "helloworld.hpp"
#include &lt;iostream&gt;

using namespace std;

void testWorld::initPhysics() {
    cout &lt;&lt; "Initiating physics..." &lt;&lt; endl;
}

int main(int argc,char** argv) {
    cout &lt;&lt; "Hello World!" &lt;&lt; endl;
    testWorld* world;
    world = new testWorld();
    world&lt;-initPhysics();
    return 0;
}
</code></pre>

<p>I compile with the command</p>

<pre><code>g++ -c hello.cpp
</code></pre>

<p>and get the error</p>

<pre><code>hello.cpp: In function ‘int main(int, char**)’:
hello.cpp:14:21: error: ‘initPhysics’ was not declared in this scope
</code></pre>

<p>Why doesn't the compiler see the declaration of initPhysics, even though I included helloworld.hpp?</p>
