Compile C Program In Dos

Best C++ compiler for DOS programs. C / C++ Forums on Bytes. 424,038 Members| 1,609 Online Join Now. Home > topics > c / c++ > questions > best c++ compiler for dos programs. Microsoft or Borland C++ compilers support DOS program development. Now I need to find some good graphical (not textual) windowing menu system library. Executing a C program in command prompt using Turbo C compiler: In the previous session we have learned how to install Turbo C++ 3.0 and execute a C program using IDE. Now we will see how we can configure Turbo C++ 3.0 for command line execution. I have a small program that uses 32bit object file, and i wish to run it under dos operating system. Now, after searching i found DJGPP. Is there a way to use DJGPP to compile my program to 16Bit.

Active6 years, 1 month ago

i have a small program that uses 32bit object file, and i wish to run it under dos operating system. now, after searching i found DJGPP.
is there a way to use DJGPP to compile my program to 16Bit dos executable format?
thanks in advance

Community
bksbks
8461 gold badge14 silver badges39 bronze badges

Compile C Programs Windows

2 Answers

Take a look at this related Stack Overflow question. It might help.

Community
Pablo Santa CruzPablo Santa Cruz
141k29 gold badges206 silver badges257 bronze badges
Program

If you want to take advantage of a 32-bit processor (386 and above) to run 32-bit code under 16-bit DOS (using DPMI), then DJGPP is definitely the right tool. That is, it produces 16-bit dos executable files containing 32-bit code. For object format it uses 32-bit COFF.

FabelFabel

Not the answer you're looking for? Browse other questions tagged ccompilationdosdjgpp or ask your own question.

Compile C Program In Dose

Madeline absolutely must run a particular DOS program for her medical transcription business. Can she do this in Windows 10?

The real issue isn’t whether you’re running Windows 7, 8, or 10. It’s whether you’re using a 32- or 64-bit version of the operating system. Any 32-bit version of Windows can handle DOS programs easily. A 64-bit version needs a little help.

[Have a tech question? As Answer Line transitions from Lincoln Spector to Josh Norem, you can still send your query to answer@pcworld.com.]

Chances are overwhelming that you’re using a 64-bit version. To find out, right-click Start and select System. In the resulting Control Panel window, check the System type.

Windows 32-bit

Just launch the DOS program (which will have either a .EXE or .COM file extension) as you would any other Windows file. The first time you do this, a window will pop up, telling you that you need a feature called NTDVM. Click Install this feature, and your program will load.

Once you’ve done that, you won’t have to do it again. DOS programs will just run in Windows.

Windows 64-bit

But if you’re running a 64-bit version of Windows (and you probably are), you’ll need a program that can run DOS in a virtual machine inside Windows. And no, that’s nowhere near as scary as it sounds.

Download and install vDos. By default, it installs to C:vDos, but I recommend you install it into a new folder you create inside your Documents folder. That way, all of your DOS data files will be backed up and protected (assuming you back up—and you should).

Ubuntu

Compile C Program In Dos

Why is this important? vDos uses the folder containing the vDos program as a virtual drive C:. Every file you access, create, or alter in the DOS environment will remain in that folder.

When you load vDos, you’ll get a DOS environment in a window. You’ll have to press any key to run a database program. Press 0 to exit that program and get to the old-fashioned DOS prompt. From there you can run any DOS command or launch any DOS program you choose.

Compile A C File

I found the vDos window uncomfortably big. You can press Win-F11 to shrink it. If you shrink it too much, press Win-F12 to enlarge it.

Compile C Program In Command Line

Then I suggest that you read the Getting Started.pdf file in Windows. If you need more information on the program, type helpat the C:> DOS prompt.