How to use graphics.h in codeblocks?
bgi, c++, codeblocks
Solution
- First download WinBGIm from http://winbgim.codecutter.org/ Extract it.
- Copy `graphics.h` and `winbgim.h` files in include folder of your compiler directory
- Copy `libbgi.a` to lib folder of your compiler directory
- In code::blocks open Settings >> Compiler and debugger >>linker settings click Add button in link libraries part and browse and select `libbgi.a` file
- In right part (i.e. other linker options) paste commands `-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32`
- Click OK
For detail information follow this link.
Problem
I have recently started learning graphics in C++. I tried `#include <graphics.h>` in my program in codeblocks but it shows error. Then I downloaded `graphics.h` header from a site and pasted in the include folder in codeblocks, yet it shows `graphics.h:No such file or directory`. Can anyone teach me how to use `graphics.h` in codeblocks?