What modern C compiler can I use to create this 1992 MS-DOS program?

I was provided with the source code to modify the MS-DOS program created in 1992. I have an exe file and it works fine, but I need to change the source code. The source code needs the following headers to compile.

#include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <dos.h> #include <dir.h> #include <alloc.h> #include <ctype.h> #include <string.h> #include <mem.h> #include <values.h> 

Does anyone know what was used, and are there any modern compilers that can handle this? I tried with Visual Studio 2010 and GCC out of the box, but it fails because some headers are missing (dir.h, alloc.h, mem.h, values.h)

+4
source share
5 answers

There Turbo C ++ 1.01 , not very modern, although it seems that all of these header files too. I still use it sometimes.

+3
source

It might be more interesting to ask what function declarations, type declarations, global variable declarations, and macros should have. The specific location of these things in the headers is not very interesting as long as they are all there.

So, comment out the #includes insult and give the compiler complaints about the bits that it is missing. Then you know what you are looking for.

+8
source

You can try the Open Watcom compiler, which is one of the few relatively modern compilers that builds 16-bit DOS executables. Besides finding the old MS or Borland compiler (or what was originally used), this is probably the easiest route.

If you want to rebuild another platform instead of reconfiguring for DOS, you will most likely have to make a lot of changes to the program itself. It may be useful, but it can be a lot of work and you have a lot of headaches.

+5
source

You can try using DJGPP . According to the documentation , it may have the right headers.

+4
source

a) Delete all header files b) Try compiling c) See which header file is undefined function / type is int d) Add header file e) repeat

+1
source

All Articles