Guest_imported
New member
- Jan 1, 1970
- 0
I'm getting unresolved external symbol errors when using interfaces. I have the following:
interface Inter
{
void print(int val);
};
class Derived: public Inter
{
public:
void print(int val)
{
cout << val;
}
};
class interfacetester
{
public:
int val;
void main(Inter i)
{
i.print(val);
};
};
Now if in my main program I do the following:
Derived* D = new Derived;
interfacetester I = new interfacetester;
I -> main(D);
I get the following compiler error:
"Unresolved external symbol: public: void __thiscall Inter:
rint(int)" (?print@Inter@@Q
Any suggestions would be appreciated.
Ron
interface Inter
{
void print(int val);
};
class Derived: public Inter
{
public:
void print(int val)
{
cout << val;
}
};
class interfacetester
{
public:
int val;
void main(Inter i)
{
i.print(val);
};
};
Now if in my main program I do the following:
Derived* D = new Derived;
interfacetester I = new interfacetester;
I -> main(D);
I get the following compiler error:
"Unresolved external symbol: public: void __thiscall Inter:
Any suggestions would be appreciated.
Ron