D
Dilip
Hi All
I have a pure virtual function in my base class that my derived
instances override. What are the likely causes for VC++ 7.1 to
complain of unresolved external symbol on that pure virtual function?
I tried to rule out the obvious mistakes. The virtual fn. is
definitely defined in the derived classes. Here is what I have:
// file a.h
class base
{
public:
virtual long somefunc() = 0;
};
template<typename T>
class derv : public base
{
virtual long somefunc();
};
// file a.cpp
template<typename T>
long derv<T>::somefunc()
{
}
I can't understand why I am getting the linker error -- what is my
mistake?
Earlier I had all these code in a single .cpp file (for testing
purposes), then I started re-organizing my project separating code into
headers and newer source files and all of a sudden the pure virtual
functions are giving me linker errors.
I have also ensured that the .cpp files of my derived classes that
define the pure virtual function generate proper .obj files.
What am i missing?
I have a pure virtual function in my base class that my derived
instances override. What are the likely causes for VC++ 7.1 to
complain of unresolved external symbol on that pure virtual function?
I tried to rule out the obvious mistakes. The virtual fn. is
definitely defined in the derived classes. Here is what I have:
// file a.h
class base
{
public:
virtual long somefunc() = 0;
};
template<typename T>
class derv : public base
{
virtual long somefunc();
};
// file a.cpp
template<typename T>
long derv<T>::somefunc()
{
}
I can't understand why I am getting the linker error -- what is my
mistake?
Earlier I had all these code in a single .cpp file (for testing
purposes), then I started re-organizing my project separating code into
headers and newer source files and all of a sudden the pure virtual
functions are giving me linker errors.
I have also ensured that the .cpp files of my derived classes that
define the pure virtual function generate proper .obj files.
What am i missing?