imagesize未定义的原因
#include <graphics.h>#include <conio.h>
#include <stdlib.h>
#include <dos.h>
#include <stdio.h>
#include <iostream>
using namespace std;
#define NULL 0
#define UP 18432
#define DOWN 20480
#define LEFT 19200
#define RIGHT 19712
#define ESC 283
#define ENTER 7181
struct snake
{
int centerx;
int centery;
int newx;
int newy;
struct snake *next;
}*head;
int grade = 60; /*控制速度的*******/
int a, b; /* 背静遮的 位置*/
void *far1, *far2, *far3, *far4; /* 蛇身指针 背静遮的指针 虫子*/
int size1, size2, size3, size4; /* **全局变量**/
int ch = RIGHT; /**************存按键 开始蛇的方向为RIGHT***********/
int chy = RIGHT;
int flag = 0; /*********判断是否退出游戏**************/
int control = 4; /***********判断上次方向和下次方向不冲突***/
int nextshow = 1; /*******控制下次蛇身是否显示***************/
int scenterx; /***************随即矩形中心坐标***************/
int scentery;
int sx; /*******在a b 未改变前 得到他们的值 保证随机矩形也不在此出现*******/
int sy;
/************************蛇身初始化**************************/
void snakede()
{
struct snake *p1, *p2;
head = p1 = p2 = (struct snake *)malloc(sizeof(struct snake));
p1->centerx = 80;
p1->newx = 80;
p1->centery = 58;
p1->newy = 58;
p1 = (struct snake *)malloc(sizeof(struct snake));
p2->next = p1;
p1->centerx = 58;
p1->newx = 58;
p1->centery = 58;
p1->newy = 58;
p1->next = NULL;
}
/*******************end*******************/
void InitInface() /*************游戏开始界面 ,可以选择 速度**********/
{
int key;
unsigned size;
int x = 240;
int y = 300;
int f;
void *buf;
setfillstyle(SOLID_FILL, BLUE); //固实填充蓝色
bar(98, 100, 112, 125); //无边框矩形
setfillstyle(SOLID_FILL, RED); //固实填充红色
bar(98, 112, 112, 114); //无边框矩形
setfillstyle(SOLID_FILL, GREEN); //固实填充绿色
bar(100, 100, 110, 125); //无边框矩形
size = imagesize(98, 100, 112, 125); //返回图形大小
buf = malloc(size);
getimage(98, 100, 112, 125, buf);
cleardevice();
setfillstyle(SOLID_FILL, BLUE);
bar(240, 300, 390, 325);
outtextxy(193, 310, "speed:");
setfillstyle(SOLID_FILL, RED);
bar(240, 312, 390, 314);
setcolor(YELLOW);
outtextxy(240, 330, "DOWN");
outtextxy(390, 330, "UP");
outtextxy(240, 360, "ENTER to start...");
outtextxy(270, 200, "SNAKE");
在以上代码中,编译器提示imagesize未定义,我也下载了easyx并放置到lib和include下。头文件也没有报错,有大佬能说明一下这个错误的原因并解决吗?谢谢!