This repository contains all the necessary compiled files needed to run the graphics.h library in your computer.
These instructions are based on DEV-CPP IDE which you can download by clicking here
- First download the
drivedownloadzip
file from the above repo and extract it on your pc. - After that extract the files and paste the
graphics.h
file and thewinbgim.h
file in the folderC:\Program Files (x86)\Dev-Cpp\MinGW64\include
.
Note
The address C:\Program Files (x86)\Dev-Cpp\MinGW64\include
is the default path for devcpp. You can have a different path if you want,
just make sure to put the header files in MinGw64\include\
folder.
-
Now copy the
libbgi.a
to theC:\Program Files (x86)\Dev-Cpp\MinGW64\lib\
folder. -
Now open up your dev cpp and on the top right corner select the
TDM-GCC 32-bit release
option as shown in the image: -
On the top of toolbar click on
Tools
and thenCompiler Options
as shown in the image: -
Now add these flags to the second box of the compiler option:
-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
and click okay.
-
Now create a new file and then compile and run this program to check if everything has been installed properly:
int main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, "");
line(100,300,200,400);
getch();
closegraph();
return 0;
}