Back: Unix/Windows Portability
Forward: Unix/Windows Portable Scripting Language
 
FastBack: Writing Portable C
Up: Unix/Windows Portability
FastForward: Writing Portable C++
Top: Autoconf, Automake, and Libtool
Contents: Table of Contents
Index: Index
About: About this document

15.3.1 Unix/Windows Emulation


The simplest way to write a program which runs on both Unix and Windows is to use an emulation layer. This generally results in a program which runs, but does not really feel like other programs for the operating system in question.

For example, the Cygwin package, which is freely available from Cygnus Solutions(33), provides a Unix API which works on Windows. This permits Unix programs to be compiled to run on Windows. It is even possible to run an X server in the Cygwin environment, so graphical programs will work as well, although they will not have the Windows look and feel. The Cygwin package is discussed in more detail in see section 25. Using GNU Autotools with Cygnus Cygwin.

There are also commercial packages available to compile Unix programs for Windows (e.g., Interix) and to compile Windows programs on Unix (e.g., Bristol Technology).

The main disadvantage with using an emulation layer is that the resulting programs have the wrong look and feel. They do not behave as users expect, so they are awkward to use. This is generally not acceptable for high quality programs.



This document was generated by Gary V. Vaughan on February, 8 2006 using texi2html