I am working on a legacy program written in C. It is a 16 bit program. I was able to open it into Visual Studio 2019 but when I tried to compile it is giving me an error "Cannot open source file "graph.h". Similar error I have received for "bios.h" and "sound.h". Is there any other header library I can replace to achieve same functionality of graph.h, bios.h and sound.h.
-
"graph.h" or "graphics.h"? – Lundin Jan 22 '21 at 14:24
-
`graph.h` is not a standard header, so probably it comes with some library that you had in the older system, and it is not available in the new. Probably you will not be able to solve easily your porting problem. – Luis Colorado Jan 23 '21 at 16:53
-
it is graph.h not graphics.h – Dharmesh Jan 26 '21 at 14:07
2 Answers
Assuming you mean graphics.h
, bios.h
and sound.h
, these were MS DOS libaries provided by Borland in the year 1989. graphics.h
specifically was used for the old Borland MS DOS graphics library "BGI". sound.h
was made to activate the "PC speaker" buzzer, used to scare away carnivore dinosaurs. These libs don't exist outside old Borland DOS compilers.
To run this ancient crap, you need a MS DOS computer with Turbo C. Or an emulator that can simulate them. If you surf the internet, there's lots of strange people putting lots of effort into getting such emulators up and running on computers made this millennium.
I would however recommend to forget all about MS DOS programming, because there is absolutely nothing to learn from running this old stuff. You should study modern tools and libraries instead, the kind that are actually used in the real world.

- 195,001
- 40
- 254
- 396
-
On modern machines, everything will also run a lot faster, so something that may play a tune will end up as a squeak. – cup Jan 22 '21 at 14:55
-
-
Could you recommend some modern tools and libraries? Is there any such thing for C? – Jimmy Jun 16 '23 at 02:06
-
1@Jimmy For PC there's the gcc, clang and icx compilers. For PC IDE I'm not the best person to ask for advise since I barely do PC programming these days - I usually use Codeblocks, Visual Studio (the IDE, not the horrible compiler) or C++ Builder. VS Code seems popular these days although not too beginner-friendly. For embedded systems I mostly use gcc, with Crossworks IDE and Segger or Lauterbach debuggers, but naturally this depends on the target. And a big anti-recommendation against anything based on Eclipse. – Lundin Jun 16 '23 at 06:39
Sometime around 1989 Microsoft introduced Quick C and the 5.0 version of the Optimizing C Compiler. Optimizing C Compiler could be configured at installation to use the special library file GRAPHICS.LIB and the header file GRAPH.H. In a much more elaborate set up, Quick C could use the same functions included in GRAPHICS.LIB. I'm pretty sure this exact configuration is not available. However at the stackoverflow location immediately below a possible substitute can be obtained. I say possible because I have not personally used the downloads listed at the location below, but the description sounds like the downloads might contain exact substitutes for the functions provided in the old GRAPHICS.LIB. Go to the location below and scroll down to the second answer by Anh Huynh. Good luck!