Include graphics.h in CodeBlocks - Run Graphics Program in C++

Pubblicato il: 16 dicembre 2017
sul canale di: Sangam Shrestha
73,605
486

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


In questa pagina del sito puoi guardare il video online Include graphics.h in CodeBlocks - Run Graphics Program in C++ della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Sangam Shrestha 16 dicembre 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 73,605 volte e gli è piaciuto 486 spettatori. Buona visione!