Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unresolved symbol errors with interfaces

Status
Not open for further replies.

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:

&quot;Unresolved external symbol: public: void __thiscall Inter::print(int)&quot; (?print@Inter@@Q


Any suggestions would be appreciated.

Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top