During the MS-DOS era, it was popular and utilized by many programs. Although, whoever is new to graphics can still learn a lot about graphics.h library and build the basic foundation of modern graphics. There are more complicated but better libraries than graphics.h. To name a few –
OpenGLDirectXSDLSFMLAllegro
If you are struggling to configure graphics in dev C++, this tutorial will explain step by step how to add graphics in dev C++.
How to add graphics in dev C++ (follow these steps)
Step 1: Download/update the latest version of dev C++
It’s a good idea to have the latest version of the Dev C++ application. With the updated version, you will likely receive new features, fewer bugs, and security patches. Go ahead and download the latest build of dev C++. I’m using version 5.11 while creating this article. You might get an upgrade, but the procedure remains the same. You can check your dev c++ version by selecting “help” from the top menu and selecting “About Dev C++.”
Step 2: Add header source files into the Dev C++ directory
Next, you need to download graphics library files and add them to the appropriate folders under the MinGW64 directory. Follow this – Double-check the include and lib folders have these files to proceed to the next step.
Step 3: Change compiler suit in Dev C++
Compiler suites combine the latest stable release of the GCC toolset and open-source MinGW runtime APIs to build an open-source alternative to Microsoft’s compiler. You must set the TDM – GCC version to the 4.9.2 32-bit release.
Step 4: Configure required linkers for graphics
Configuring linkers is vital; this program will help link a program’s object modules into a single object file. For graphics.h setup, you will need these linkers to be set for the selected compiler suite, aka TDM - GCC 4.9.2 32-bit release. Steps to configure graphics.h linkers: When complete, you are ready to use graphics.h header in your c or c++ programs.
Step 5: Verify whether graphics.h header is working (optional)
Create a new source file and write a program to test graphics.h header. You can try it with anything you want; for example, I’m trying to print GANA (in the Hindi language) using basic graphics output primitives… And here’s the output: Still unable to add graphics in Dev C++? Eventually, this guide should get your graphics.h header to work with the Dev C++ application. If you haven’t followed the process thoroughly to avoid skipping steps… or if that’s not the case, then probably uninstall any previous version of Dev C++ and have the latest build. Then follow these steps again. 📝 Similar Articles: