Back to Browse

How to setup graphics.h in CodeBlocks || How to Install graphics.h in Code::Blocks

4.7K views
Jul 10, 2021
16:02

How to Install graphics h in Code::Blocks, Problem Solved Graphics.h Please follow below steps in sequence to include “graphics.h” in CodeBlocks to successfully compile graphics code on Codeblocks. Step 1 : To setup “graphics.h” in CodeBlocks, first set up winBGIm graphics library. Download WinBGIm from http://winbgim.codecutter.org/ Step 2 : Extract the downloaded file. There will be three files: i) graphics.h ii) winbgim.h iii) libbgi.a Step 3 : Copy and paste graphics.h and winbgim.h files into the include folder of compiler directory. Step 4 : Copy and paste libbgi.a to the lib folder of compiler directory. Step 5 : Open Code::Blocks. Go to Settings→ Compiler→ Linker settings. Step 6 : In that window, click the Add button under the “Link libraries” part, and browse. Select the libbgi.a file copied to the lib folder in step 4. tep 7 : In right part (ie. other linker options) paste commands -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 Step 8 : Try compiling a graphics.h program in C or C++, still there will be an error. To solve it, open graphics.h file pasted in include folder in step 3 with Notepad++. Go to line number 302, and replace that line with this line : int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX, Step 9 : Save the file. Done !

Download

1 formats

Video Formats

360pmp422.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How to setup graphics.h in CodeBlocks || How to Install graphics.h in Code::Blocks | NatokHD