Configuring DevC++ :
To run graphics programs in DevC++ we first need to download some files and after download we have to paste those files in its correct position. Just follow the steps given bellow properly -
Step
1: Download necessary files,
to download click here.
Step
2: Extract the contents of
the zip file.
Step
3: Go to the location where
DevC++ is installed, let its E drive. Now copy the graphics.h and winbgim.h file form the extracted folder
and paste it into the E:\Dev-Cpp\MinGw64\include folder and E:\Dev-Cpp\MinGw64\x86-64-w64-mingw32\include folder.
Step
4: Now copy the libbgi.a file into the E:\Dev-Cpp\MinGw64\lib folder and in E:\Dev-Cpp\MinGw64\x86-64-w64-mingw32\lib folder.
Step
6: Copy the ConsoleAppGraphics.template and ConsoleApp_cpp_graph.txt files and paste them
inside the E:\Dev-Cpp\Templates floder.
Now we are done with configuring of the Dev-C++ to
support graphics programming.
Running the graphics program :
Step 1: Open Dev-C++ , Click file -> New -> Project.
Step 2: Now give a project name and make sure that the selected language is C++ and also make sure that you get the Console Graphics option.
Step 3: Choose the TDM-GCC 32-bit Profiling.
Step 4: Copy the following code to the editor window and save it.
Step 5: Go to project menu and choose Project Options.
Step
6: Now go to the Parameters tab and in the Linker field, enter the
following text:
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
Step
7: Click OK .
Step 8: Now compile and run the code to see the output.










No comments:
Post a Comment