c++结构体编译错误及绘图库函数问题

Butterfly_lily1204 2016-12-11 08:53:41
在vc6中,我在graph.h中定义了雷的结构体,在.cpp中写了以下两个方法,可是编译的时候,提示说thunder没有定义,请问这是怎么回事?我的其他结构体都不会报错的。

还有,我用graphics.h的库函数circle(int,int,int)画圆,可是编译时提示参数错误。谢谢大神们

C:\Program Files\Microsoft Visual Studio\MyProjects\colorfulRain\colorfulRain.cpp(19) : error C2872: 'circle' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\MyProjects\colorfulRain\colorfulRain.cpp(19) : error C2661: 'circle::circle' : no overloaded function takes 3 parameters

C:\Program Files\Microsoft Visual Studio\MyProjects\colorfulRain\colorfulRain.cpp(109) : error C2027: use of undefined type 'thunder'

struct thunder{//雷
int X1;//坐标1
int Y1;//坐标1
int X2;//坐标2
int Y2;//坐标2
int X3;//坐标3
int Y3;//坐标3
int X4;//坐标4
int Y4;//坐标4
struct thunder *next;//下一个雷
};

#graphics.h
struct thunder *makethunder(){
struct thunder *p;
p=(struct thunder*)malloc(sizeof(struct thunder));
p->X1=random(640);
p->Y1=random(300);
p->X2=p->X1-random(20);
p->Y2=p->Y1+random(20);
p->X3=p->X2+random(20);
p->Y3=p->Y2+random(15);
p->X4=p->X3-random(20);
p->Y4=p->Y3+random(30);
}

void drawthunder(struct thunder *p){
setcolor(WHITE);
line(p->X1,p->Y1,p->X2,p->Y2);
line(p->X2,p->Y2,p->X3,p->Y3);
line(p->X3,p->Y3,p->X4,p->Y4);
}
...全文
290 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ooolinux 2016-12-11
  • 打赏
  • 举报
回复
graphics.h是第三方的库吗?

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧