G
Guest
I have just installed VC++2005 Express Ed. and I keep getting a LNK2001
error:unresolved external symbol "public: virtual void __thiscall
Circle::draw(void)const " (?draw@Circle@@UBEXXZ)
when building the following code:
class Coord {
private:
int x, y;
public:
Coord (int i1, int i2) : x(i1), y(i2) {}
};
class GeoObj {
public:
// draw geometric object:
virtual void draw() const = 0;
};
// concrete geometric object class Circle
// - derived from GeoObj
class Circle : public GeoObj {
public:
virtual void draw() const;
};
// draw any GeoObj
void myDraw (GeoObj & obj)
{
obj.draw(); // call draw() according to type of object
}
int main()
{
Circle c;
myDraw(c); // myDraw(GeoObj&) => Circle::draw()
return 0;
}
Thanks
Eugene
I did unsuccessfully try all the prescribed remedies. Any ideas?
error:unresolved external symbol "public: virtual void __thiscall
Circle::draw(void)const " (?draw@Circle@@UBEXXZ)
when building the following code:
class Coord {
private:
int x, y;
public:
Coord (int i1, int i2) : x(i1), y(i2) {}
};
class GeoObj {
public:
// draw geometric object:
virtual void draw() const = 0;
};
// concrete geometric object class Circle
// - derived from GeoObj
class Circle : public GeoObj {
public:
virtual void draw() const;
};
// draw any GeoObj
void myDraw (GeoObj & obj)
{
obj.draw(); // call draw() according to type of object
}
int main()
{
Circle c;
myDraw(c); // myDraw(GeoObj&) => Circle::draw()
return 0;
}
Thanks
Eugene
I did unsuccessfully try all the prescribed remedies. Any ideas?