How To Put Graphics H In Dev C%2b%2b

Dec 12, 2018 graphics programming in dev c with examples graphics in dev c rar graphics in dev c free download bgi graphics c graphics.h download for code blocks dev c include library how to add. DEV-C is a fully-featured integrated development environment (IDE) for creating, debugging and creating applications written in a popular C.

Compiling graphics codes on CodeBlocks IDE shows an error: “Cannot find graphics.h”. This is because graphics.h runs is not available in the library folder of CodeBlocks. To successfully compile graphics code on CodeBlocks, setup winBGIm library.

How to include graphics.h in CodeBlocks ?

How to put graphics h in dev c 2b 2b 4

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/ or use this link.

Step 2 : Extract the downloaded file. There will be three files:

  • graphics.h
    • A tutorial of how to get the graphics.h functions in dev csad.
    • Graphics.h (download to C: Dev-Cpp include) libbgi.a(download to C: Dev-Cpp lib) Once you download the files. Now you have to place into the correct location in Dev-C installation folder. Try to locate include and lib folder under your dev-cpp installation. Move these files under the respective folder of include and lib.
    • Graphics In Dev C Download Creating 2D graphics programs under DOS is easy if you’re using turbo c. There is library file called graphics.h that does the tiresome work for you. But unfortunately this library is borland specific you can’t use it on other compilers.
    • How To Put Graphics H In Dev C Online Graphics In Dev C Download Putpixel function plots a pixel at location (x, y) of specified color.
  • winbgim.h
  • libbgi.a
  • Step 3 : Copy and paste graphics.h and winbgim.h files into the include folder of compiler directory. (If you have Code::Blocks installed in C drive of your computer, go through: Disk C >> Program Files >> CodeBlocks >> MinGW >> include. Paste these two files there.)


    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.

    Step 7 : In right part (ie. other linker options) paste commands

    -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

    DevHow To Put Graphics H In Dev C%2b%2b

    Step 8 : Click Ok

    Step 9 : 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 10 : Save the file. Done !

    Note : Now, you can compile any C or C++ program containing graphics.h header file. If you compile C codes, you’ll still get an error saying: “fatal error: sstream : no such file directory”.

    For this issue, change your file extension to .cpp if it is .c

    How To Put Graphics H In Dev C 2b 2b 1b