Setup DevC++ for Computer Graphics Lab
To run C or C++ programs that require the use of a graphics library in DevC++, follow along.
We all share the hate for TurboC3 and hence the genesis for this article. I was compelled to write one. Things will work fine if you use TurboC3 for your Graphics lab work, but it seriously sucks.
Steps to run graphics in DevC++:
- Make a new project, not a new individual source file.
- Inside the project, make files that are interrelated (thus only 1 main function for the entire project)
3. DevC++ → Tools → Compiler Options, and write the following as shown in the image.
-static-libgcc -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
4. Select TDM-GCC 4.9.2 32-bit-release from the above menu for the choice of compiler, play around with using the 64-bit version, but 32-bit worked for me just fine.
5. Header files to use:
6. Sample main ()
initgraph(&gd, &gm, "C:/TURBOC3/BGI");
outtextxy(10,80,"ENTER UR CHOICE:");
7. Rest, if you still get some error like `-lgbi not found` or some other error, then you can find out how to resolve them over the internet.
Do a quick Google search to get these files if they are not present in your installation.
that’s all folks. Enjoy.
I hope you got clarity out of this article and would love to hear your thoughts about (I missed something?), so feel free to reach out to me on LinkedIn or Twitter or respond in the comments below/sideways.
Do reach out, I would love to talk to you.
— If this article helped you in any way, consider sharing it with 2 friends you care about.
Till then stay alive.