can anyone suggest me how to execute graphics programs(such as DDA line algo) using GCC compiler under windows?

graphics.h is a part of turbo c and is not available in gcc..

so is there any way to do this??

5 Years
Discussion Span
Last Post by Schol-R-LEA

so is there any way to do this??

Install Turbo C?

But seriously, why use such an old library? There is plenty of better, newer, cross platform alternatives. Look up SDL, OpenGL and Glut, or if you are evil and don't care about cross-platformness DirectX or XNA.

If you really want to use turbo graphics library you will need to get the headers and the .lib file.
I am not sure, but if turbo graphics library is DOS-only you cannot run it on modern Windows because it tries to acess hardware directly. You will need Dosbox to run it then.

Edited by ModernC++


That depends on a) the operating system (and window manager) you are using, and b) whether you are free to use third party libraries. There are no C standard libraries that address graphics, or indeed any form of I/O other than buffered streams; however, there are many different 3rd party graphics libraries, some of which are portable across multiple environments, such as GTK+, Qt, and wxWidgets.

OTOH, if you only need to support, say, Windows, you could use the native Win32 API (or its Win8 successor, WinRT), which provides the primitives for graphics and window management. However, Win32 programming is a bit of an uphill battle, and the usual frameworks needed for Windows development (MFC, .NET) are specific to the Microsoft development tools.

My recommendation is to choose a widget toolkit, and use that, rather than trying to program in the Win32 API directly; not only is it going to be easier, it will allow you to write programs that are portable across Linux and MacOS, which is a definite plus.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.