This tutorial is slightly modified please visit https://sangams.com.np/adding-graphic... for instruction that works with CodeBlocks 20.03 and all other old versions.
Download from here: https://sangams.com.np/use-graphics-h...
graphics.h can be used in CodeBlocks by adding WinGBIm in MinGW compiler. Some header files and library files should be copied in the compiler directory & linker should be configured to run graphics program in CodeBlocks using C and C++.
If you are getting sstream not found, then you probably trying to run a .c file program. sstream is c++ header so graphics.h won't works with c.
1. Download WinBGIm. Downloading from other website may not work.
2. Extract it.
3.Open info.txt for linker options and more information.
4. Copy MinGW folder to your Code::Blocks installation directory. Default Code::Blocks installation directory is C:\Program Files (x86)\CodeBlocks. There will be MinGW folder already. Copying new MinGW folder only adds some library (libbgi.a) and header (winbgim.h, graphics.h) files in that directory. To manually add files, copy graphics.h and winbgim.h files in include folder of your compiler directory which is C:\Program Files (x86)\CodeBlocks\MInGW. And copy libbgi.a to lib folder of your compiler directory.
5. Open Code::Blocks. In open Settings - Compiler - Linker Settings. Click Add button in link libraries part and browse and select libbgi.a file you just copied to MinGW folder.
6. In right part (i.e. other linker options) paste commands -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
7. Click OK.
If you don't find MinGW inside codeblocks check in C:\MinGW
Auf dieser Seite können Sie das Online-Video Include graphics.h in CodeBlocks - Run Graphics Program in C++ mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Sangam Shrestha 16 Dezember 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 73,605 Mal angesehen und es wurde von 486 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!