Class implementation in multiple files
<p>I am trying to implement a class in different cpp files. I understand it is a legitimate thing to do in C++ if the member functions are independent. However one of the member function uses another member function such as in this case:</p>

<p>In function1.cpp</p>

<pre><code>#include "myclass.h"
void myclass::function1()
{ 
    function2();
}
</code></pre>

<p>In function2.cpp</p>

<pre><code>#include "myclass.h"
void myclass::function2()
{
....
}
</code></pre>

<p>I will get an error of undefined reference to function2. It doesn't work by adding this pointer either. Do I need to declare it in some way in function1.cpp? Thanks~</p>

<p>The header file includes declaration of both functions. It works when function1 and function 2 are in the same file but not when I separate them. I also believe I've added both cpp in the project. I am using Qt creater btw.</p>
