1

I am new to code::blocks, so I was wondering how could I compile and run my computer graphics animation programs (those that use graphics.h) in Code::Blocks.

Is this possible with the default installation?

genpfault
  • 51,148
  • 11
  • 85
  • 139
jackuars
  • 1,193
  • 2
  • 12
  • 12
  • Possible duplicate of [How to use graphics.h in codeblocks?](https://stackoverflow.com/questions/20313534/how-to-use-graphics-h-in-codeblocks) – Mukesh M Sep 20 '17 at 05:02

1 Answers1

1

This is impossible. You can't use graphics.h without a time machine, so you're better off forgetting about it altogether. This question gets asked about once a week, and the consensus is always the same.

The graphics.h header is a proprietary graphics library included with Borland compilers back in the early 1980s. It is not a standard C or C++ library, and hasn't been modern or relevant for at least 20 years. It should come as no surprise that it does not work with modern compilers, or on modern operating systems. Using or learning to use it is an utter and complete waste of time. If your educational system is insisting upon you doing so, you should be entitled to a complete refund of your tuition.

It's good that you're moving up to a modern IDE like Code::Blocks. You should also upgrade your library and toolkits while you're at it. If you want to write graphics applications, you're undoubtedly going to be doing so in a graphical environment like Windows or X. You might as well learn the way to do it there, rather than getting lines to appear in an MS-DOS emulator and marveling at the appeal of retro tech.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • > You should also upgrade your library > and toolkits while you're at it. how can i do this? > > If you want to write graphics > applications, you're undoubtedly going > to be doing so in a graphical > environment like Windows or X. and this too. sorry for bugging you again, and thanks for your fast reply :-) i just want to run my graphics programs learn at college. could you tell me how. At our lab we use xterm on linux – jackuars Feb 21 '11 at 06:33
  • @user: It depends on what environment you are intending to target with your programs. The point is that you're probably not writing console applications (and certainly not 16-bit DOS apps) anymore, so using a graphics library intended for them is a pointless endeavor. If you want to write Windows applications, GDI or GDI+ are the standard graphics libraries. Something like OpenGL is also an option. I'm not really a Linux/Unix programmer, so I don't know what's commonly used there. – Cody Gray - on strike Feb 21 '11 at 06:39
  • The easier solution would be the [Qt library](http://qt.nokia.com/). Works pretty much the same on Linux and Windows, far easier than GDI and OpenGL. – MSalters Feb 21 '11 at 09:16