نبود graphics.h در ++Microsoft Visual C
سلام
یه برنامه نوشتم تو Microsoft Visual C++ ( البته خودم ننوشتم ؛ از رو یه کتاب کپی کردم ) که موقع کامپایل این error رو می ده :
کد:
Compiling...
rect-draw.cpp
f:\programming\rect-draw.cpp(2) : fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
Error executing cl.exe.
rect-draw.obj - 1 error(s), 0 warning(s)
خود برنامه هم اینه :
کد:
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
class rect
{
public :
void drawrect(int x1,int y1,int x2,int y2,int boundarycolor)
{
setcolor(boundarycolor);
rectangle(x1,y1,x2,y2);
}
};
class filledrect : public rect
{
public :
void drawrect(int x1,int y1,int x2,int y2,int boundarycolor,int pattern,int patterncolor)
{
rect::drawrect(x1,y1,x2,y2,boundarycolor);
struct fillsettingstype t;
getfillsettings(&t); //collect current fill pattern
setfillstyle(pattern,patterncolor); //set new fill pattern
floodfill(x1+1,y1+1,boundarycolor); //fill rectangle
setfillstyle(t.pattern,t.color); //reset original fill pattern
}
};
class animatedfilledrect : public filledrect
{
public :
void drawrect(int x1,int y1,int x2,int y2,int boundarycolor,int pattern,int patterncolor)
{
filledrect::drawrect(x1,y1,x2,y2,boundarycolor,pattern,patterncolor);
int size=imagesize(x1,y1,x2,y2);
char *p;
p = new char[size];
getimage(x1,y1,x2,y2,p);
putimage(x1,y1,p,XOR_PUT);
int x,y;
while(!kbhit())
{
x=random(getmaxx());
y=y2+random(getmaxy());
putimage(x,y,p,OR_PUT);
delay(100);
putimage(x,y,p,XOR_PUT);
}
}
};
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"F:\\TURBOCPP\\BGI"); //initialize graphics system
rect x;
x.drawrect(5,5,200,100,RED);
filledrect y;
y.drawrect(210,5,410,100,YELLOW,SOLID_FILL,MAGENTA);
animatedfilledrect z;
z.drawrect(420,5,620,100,YELLOW,HATCH_FILL,GREEN);
getch();
closegraph(); //shut down graphics system
restorecrtmode();
}
ممنون از راهنمایی تون
__________________________________________________ __________________
پ.ن : من TURBOC++ رو هم دارم که اون "graphics.h" و فایل library اون رو هم داره...نمی شه از اون کپی کنم به فولدر MVC++ ؟؟؟