I had my template class with two-file organization
I included this class in my main program (#include "Myclass.h") and everything worked untill at some point after I added some stuff in my main program and add another class it gives me error "template function has already been defined" for every single member function in the template class. I could get away from getting that error by putting evertyhing in one file "MyClass.h" but I kinda like the two-file organization above.Code:// MyClass.h #ifndef MY_CLASS_H #define MY_CLASS_H template <class T> class MyClass { ... }; #include "MyClass.cpp" #endif //MyClass.cpp #include "Myclass.h" ...
So, what's wrong
Note that everything runs fine with two files when I compile using g++ but not .NET