Dev-Cpp is an application which is used to code and run programs in C/C++. It has its variations but none of them come with a pre-installed graphics library. So if you are switching from some primitive editor like TurboC to Dev-Cpp (which follows ANSI specifications correctly) and try to write the following code, it won’t compile.
You will get an error saying “Could not find graphics.h”.
What you need to do is visit the following link, and download the file
http://tinf.ti.funpic.de/_nicht_loes...0-1g17l.DevPak
You will have to install it. The problem is that it sometimes experiences a malfunction, in which case you open it with “WinRAR” (or an equivalent software) and just extract “graphics.h” to the include directory of your Dev-Cpp installation.
Now, when you create a project, go to Project->Project Options and select the Parameters tab. In this, under the “Linker” field, type in the following. (including the ‘-’)
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
And voila! Once you have this installed and the above changes made, you do not need anything more and can simply run the above code to test it. Now get started with writing whatever code you want, using your newly acquired “graphics.h” functions!
Code:
#include<iostream>
#include<graphics.h>
using namespace std;
int main()
{
int gm=DETECT, gd;
initgraph(&gm,&gd,”C:\\Dev-Cpp\\lib”);
cleardevice();
circle(200,200,50);
getch();
closegraph();
return 0;
}
What you need to do is visit the following link, and download the file
http://tinf.ti.funpic.de/_nicht_loes...0-1g17l.DevPak
You will have to install it. The problem is that it sometimes experiences a malfunction, in which case you open it with “WinRAR” (or an equivalent software) and just extract “graphics.h” to the include directory of your Dev-Cpp installation.
Now, when you create a project, go to Project->Project Options and select the Parameters tab. In this, under the “Linker” field, type in the following. (including the ‘-’)
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
And voila! Once you have this installed and the above changes made, you do not need anything more and can simply run the above code to test it. Now get started with writing whatever code you want, using your newly acquired “graphics.h” functions!


