Free C(++) compiler for DOS but runs on Windows

AI Thread Summary
Free C and C++ compilers that can create DOS programs while running on Windows Vista include MinGW and Open Watcom, which are recommended for their compatibility. Testing in a DOS virtual machine is suggested for safety. The MS-DOS wiki and legacy programming groups may provide additional resources. Alternatives include older Microsoft compilers available through platforms like Amazon or eBay, and using Virtual PC to create a suitable environment for compiling DOS applications. Compilers that generate real mode code are necessary for compatibility with DOS 6.22, with Microsoft Visual C++ 1.52 being the last version capable of this without extensive modifications. Other options include DJGPP and Borland C++ Compiler 5.5, both of which are available for free.
technoweasel
Messages
15
Reaction score
0
Just a quick question. I have tried searching, but Google is fairly useless for me.

Do any of you know of free C or C++ compilers that can create programs for DOS but run on Windows (specifically, Vista)? I have an old DOS machine but don't want to have to write code on it. Instead, I want to write and test code on my primary computer, recompile it for MS-DOS, and then put it on the old computer. I have had quite a bit of trouble with getting anything to work.

Any help would be greatly appreciated.
 
Technology news on Phys.org
In theory anything that runs in a cmd shell will run on DOS, so long as you don't use os dependent libraries, because the cmd shell is a DOS emulation environment. MinGW and the like and testing in a DOS vm is probably your safest bet. The ms-dos wiki has some paths that look promising.
http://lists.thedatalist.com/pages/MS_DOS.php
I also found an old MS-DOS programmers usenet group, which makes me think you may want to poke around the msdn sites. Maybe someone still maintains legacy apps?

Try this: http://www.frontiernet.net/~fys/newbasic.htm
I found it at a page full of http://www.frontiernet.net/~fys/index.htm and it seems promising.

I found one that says it's a c/c++ compiler that works on everything, but requires some specific version of c/c++: http://www.openwatcom.org/index.php/Main_Page

source page listing other compilers that might work

there's also freedos.org
 
Last edited by a moderator:
I used the Watcom C++ compiler back in the days of Windows 3.1. One of it's features was full support of winmem32, allowing 32 bit applications to run on Window 3.1 without requiring the win32s add-on to Windows 3.1. Microsoft's compiler set only provided an assembly listing (not even source) of an example winmem32 app with just two calls, while Watcom did a full implementation, treating winmem32 as a model type (similar small, medium, large models). This was a short lived advantage, as Windows 95 was released within a year or two after winmem32 (winmem32.dll) was made part of Windows 3.x.

Another alternative would be to find a very old 16 bit Microsoft compiler, perhaps on Amazon or Ebay, or maybe it's available as MSDN. The last version I used was a merge of MSC 8.00c, programers workbench from MSC 7, and Masm 6.11.
 
Last edited by a moderator:
x64 windows will not run 16 bit dos programs, so you have to use a virtual machine to run the apps.

There are a lot of old compilers for 16 bit DOS that you can get your hands on, so maybe your best bet is just to install them on the DOS machine, then copy the *.cpp file to the DOS machine, and compile it from there. Visual Studio, for instance, will probably not compile programs that can run on DOS 6.22 without some serious tweaking, but you can save the file and compile it on another machine with a native compiler.
 
If you need it to run on 'real' dos rather than just in a cmd prompt you need a compiler that can generate real mode code

The last Visual Studio that can do this is Microsoft Visual C++ 1.52, it's a free download if you have an MSDN subscription,

If you have an extended memory manager you can use 32bit code generated by newer versions of VS or there is a DOS port of gcc (http://www.delorie.com/djgpp/) or there is a free download of Borland C++ Compiler 5.5
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top