I have a problem connecting two .cpp files in C++. Here are my files
Header.h
//Header.h
template <class T> class asd{
asd();
check();
print();
}
file1.cpp
//file1.cpp
//defines all methods in class asd
#include "Header.h"
template<class T> asd<T>:: asd(T a, T b){//codes}
template<class T> T asd<T>:: check(T a){//codes}
template<class T> void asd<T>::print(){//codes}
file2.cpp
//file2.cpp
//main method
#include "Header.h"
int main(){//codes}
The thing I do not understand is that the code runs fine when I put main() inside file1.cpp, but it wont compile when I separate them into two files. Can someone please give pointers?
Edit: For those with the same problem, solution can be found here: http://www.cplusplus.com/forum/articles/14272/