DarkLizener
January 5th, 2006, 10:42 AM
Hi
Here is my problem:class A
{
public:
// Constructor and so on....
template <typename T>
int func(T* const& var);
//....
// in the .cpp:
template <typename T>
int A::func(T* const& var) { var->DoSmth(); return 1; }I included the header into an other classes cpp like://class B .cpp
void B::somefunc()
{
A a;
CDoSmthClass *ds = new CDoSmthClass();
// now I want to call class A's func
a.func(ds);
// The linker fails at this point saying "... unresolved external... public: int __thiscall A::func.......When I use the func method eg. in class A's constuctor with the CDoSmthClass it compiles without link error!!???!?
Here is my problem:class A
{
public:
// Constructor and so on....
template <typename T>
int func(T* const& var);
//....
// in the .cpp:
template <typename T>
int A::func(T* const& var) { var->DoSmth(); return 1; }I included the header into an other classes cpp like://class B .cpp
void B::somefunc()
{
A a;
CDoSmthClass *ds = new CDoSmthClass();
// now I want to call class A's func
a.func(ds);
// The linker fails at this point saying "... unresolved external... public: int __thiscall A::func.......When I use the func method eg. in class A's constuctor with the CDoSmthClass it compiles without link error!!???!?