Linking a .cpp file containing a class
<p>How to do this?
I'm using a .cpp file which contains the class and all it's methods, a .hpp file which contains linked libraries.
If I want to compile a file having the main function, how to do this? Should I declare an extern class?
Can I have an example of how linking classes?</p>

<p>This is the class in the cpp file:
<a href="http://pastebin.com/aQqT0GNx" rel="nofollow">http://pastebin.com/aQqT0GNx</a></p>

<p>This is the .hpp file:</p>

<pre><code>#ifndef LIST_HPP
#define LIST_HPP

#include &lt;iostream&gt;

using namespace std;


#endif
</code></pre>

<p>This is the main file:</p>

<pre><code>#include "List.hpp"

int main(int argc, char **argv)
{
    List&lt;int&gt;l;
    return 0;
}
</code></pre>

<p>It says 'List' is not declared on this scope.</p>

<p>@Bo Persson: It seems like you're one of the few who has really understood my question.I programmed in C so I know how to separate a header from source files,but the problems was with templates.</p>
