Compile as DOS application?
Brian Inglis
Brian.Inglis@SystematicSW.ab.ca
Sun Jun 1 22:06:51 GMT 2025
On 2025-06-01 10:47, Eric J Korpela via Cygwin wrote:
> To be more explicit, a text mode windows program is not a DOS program. It
> will do anything useful on a DOS system without windows.
>
> If you desire 32-bit protected mode DOS programs, DJGPP may be your best
> option. New builds of DJGPP are available at http://www.delorie.com/djgpp/
> . I'm not sure if the current binaries run correctly under cygwin as they
> are programs that run under a DOS extender. They used to work under
> Windows and OS/2, but it's been a while since I tried them on a recent
> version of Windows.
Cygwin DJGPP compilers:
5.4.0-1 djgpp-gcc-ada
5.4.0-1 djgpp-gcc-core
5.4.0-1 djgpp-gcc-debuginfo
5.4.0-1 djgpp-gcc-fortran
5.4.0-1 djgpp-gcc-g++
5.4.0-1 djgpp-gcc-objc
5.4.0-1 djgpp-gcc-objc++
Cygwin DJGPP build utilities:
2.25-2 djgpp-binutils
2.25-2 djgpp-binutils-debuginfo
Cygwin DJGPP DOS Extender:
2.05-1 djgpp-runtime
IIRC DJGPP developers all ran under Windows and the programs were compatible
with Windows DOS extender (which may no longer be supported).
DJGPP also supports Unix cross-builds to DOS.
> If you need 16-bit real mode or 16-bit protected mode DOS binaries,
> OpenWatcom is an option. (It can also do 32-bit binaries, but if you are
> compiling code meant for GCC, DJGPP may be the better option). You can
> find it at https://github.com/open-watcom/open-watcom-v2 . OpenWatcom is
> included in distributions of FreeDOS.
Open/Watcom were competitors for Turbo C/Borland CPP etc. but both offered
little in way of POSIX support compared to DJGPP, where we tried to keep up with
functionality required by supported GNU packages and applications, although
there is support for only a few core GNU and other *libraries*.
IIRC DJGPP also provided Watcom compilers.
https://www.delorie.com/djgpp/doc/ug/compiling/portother.html
Start with:
https://www.delorie.com/djgpp/zip-picker.cgi
> On Sat, May 31, 2025 at 10:50 AM Lee via Cygwin wrote:
>> On Sat, May 31, 2025 at 11:16 AM Jon Turney via Cygwin wrote:
>>> On 31/05/2025 01:33, Takashi Yano via Cygwin wrote:
>>>> On Sat, 31 May 2025 09:00:10 +0900, Takashi Yano wrote:
>>>>> On Sat, 31 May 2025 00:39:24 +0200, Dan Shelton wrote:
>>>>>> Does Cygwin have a compiler which allows compiling ISO C applications
>>>>>> as DOS *.exe?
>>> Actually, we do have a package for an (old) version of djgpp, which I
>>> believe targets DOS executables.
>> At this point I'm pretty much a cargo-cult programmer, but for
>> whatever it's worth
>> i686-w64-mingw32-gcc
>> will build a non-gui *.exe program - which is a dos program, yes?
>> and for a windows program:
>> if test $target_type = mingw; then
>> WIN_ONLY=
>> CFLAGS="$CFLAGS -DWINVER=0x501"
>> SPECIAL_CFLAGS="-mwindows"
>> dnl from the cygwin FAQ: The regular setup allows you to use the
>> -mwindows option
>> dnl to include a set of the basic libraries user32, gdi32 and comdlg32.
>> dnl (and also make your program a GUI program instead of a console program)
>> PTHREAD_LIB=-lpthread
>> echo "Using mingw32 (Win32 GUI)"
>> else
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry
More information about the Cygwin
mailing list