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.

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.




On Sat, May 31, 2025 at 10:50 AM Lee via Cygwin <cygwin@cygwin.com> wrote:

> On Sat, May 31, 2025 at 11:16 AM Jon Turney via Cygwin
> <cygwin@cygwin.com> 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:
> > >>> Hello!
> > >>>
> > >>> 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
>
> Regards,
> Lee
>
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to