头文件是这样的:
#include "Lib110ct.h"
class Circle
{
protected:
double mx, my, mdx, mdy, mradius;
public:
Circle(){}
Circle(double x,double y,double dx,double dy,double rad):mx(x),my(y),mdx(dx),mdy(dy),mradius(rad){}
void setPos(double x, double y){mx=x;my=y;}
void setDir(double dx, double dy){mdx=dx; mdy=dy;}
void setRadius(double rad){mradius=rad;}
double getX(){return mx;}
double getY(){return my;}
void draw(Turtle * t);
void clear(Win110ct& win);
void move();
bool collides(Circle & c);
};
#include "shape.h"
int main(int argc, char** argv)
{
Win110ct win;
Turtle * t = win.getTurtle();
Circle Circle;
Circle.setPos(100, 300);
Circle.setRadius(12);
getX();
getY();
Circle.draw(t);
return 0;
}
它给我的错误信息是:
C:\Users\Oluwaseun\Documents\110ct\challenge2\programming\programming\main.cpp|13|未定义引用 `Circle::draw(Turtle*)'|
我究竟做错了什么?