FDOSTUI
FreeDOS Text User Interface
Compiling and Linking

Macros

Following are the preprocessor macros that are used when compiling applications.

Macro Description ---------—
NT Windows target
FLAT 32-bit addressing mode
CURSES GNU/Linux or BSD target

Caveats

FDOSTUI uses "unsigned char" for character types. By default, Open Watcom compiler reports to use this, which can be toggled off by the 'j' switch. It appears, however, that the C++ compiler defaults to signed char and will generates errors. Therefore, when passing paramaters to routines accepting an unsigned char it is neccessary to use a cast to elminate the error.

FreeDOS

FDOSTUI uses the Open Watcom C/C++ compiler and tools.

Other compiler tools will not work because assembler routines expect the __watcall register passing conventions. In addition, library calls specific to Open Watcom are used throughout the code.

16-bit Real Mode

The library can not be compiled in the small, compact or huge memory models. Use either the medium (mm) or large (ml) memory model. The default memory model is medium.

To compile, change into the make directory of FDOSTUI, and type "wmake -f owd16.mak."

cd \source\fdostui\make
wmake -f owd16.mak

The above command will build the object files and library. The object files are placed in the "..\obj\owd16" directory and library "fdtuid16.lib" in the "..\lib" directory.

Applications

Flags

-mm -0 -bt=DOS

Compiling

wpp -mm -0 -bt=DOS -i=\source\fdostui\include hello.cpp

Linking

wlink system dos op stack=4096 file hello.obj,\source\fdostui\lib\fdtuid16.lib

32-bit Protected Mode

The library can be compiled for 32-bit Protected Mode.

To compile, change into the make directory of FDOSTUI, and type "wmake -f owd32.mak."

cd \source\fdostui\make
wmake -f owd32.mak

The above command will build the object files and library. The object files are placed in the "..\obj\owd32" directory and library "fdtuid32.lib" in the "..\lib" directory.

Applications

Flags

-3r -mf -bt=DOS

Compiling

wpp386 -mf -3r -bt=DOS -i=\source\fdostui\include hello.cpp

Linking

Open Watcom provides both the CauseWay and Tenberry DOS/4GW extenders. The FDOSTUI library should work with either of them transparently. However, the CauseWay extender is preferred because it is free software.

wlink system causeway op stack=4096 file hello.obj,c:\source\fdostui\lib\fdtuid32.lib

Windows

The library can be compiled for 32-bit Windows.

Open Watcom

To compile, change into the make directory of FDOSTUI, and type "wmake -f oww32.mak."

cd \source\fdostui\make
wmake -f oww32.mak

The above command will build the object files and library. The object files are placed in the "..\obj\oww32" directory and library "fdtuiw32.lib" in the "..\lib" directory.

Applications

Flags

-3r -mf -bt=NT

Compiling

wpp386 -mf -3r -bt=NT -i=\source\fdostui\include hello.cpp

Linking

wlink system nt op stack=4096 file hello.obj,c:\source\fdostui\lib\fdtuiw32.lib

MinGW

The library can be compiled using the GNU compiler collection provided by MinGW. For Windows see msys2. Under GNU/Linux, see your distributions MinGW cross compilation package.

To compile, change into the make directory of FDOSTUI, and type "make -f mingw.mak." To work correctly, this requires GNUMake as the make tool.

cd ~/source/fdostui/make
make -f mingw.mak

The above command will build the object files and library. The object files are placed in the "..\obj\mingw" directory and library "libfdtuimgw.a" in the "..\lib" directory.

Applications

Flags

-D__FLAT__ -D__NT__

Compiling

c++ -c -D__FLAT__ -D__NT__ -I ~/source/fdostui/include hello.cpp

Linking

c++ -o hello hello.o -static -static-libgcc -static-libstdc++ -L ~/source/fdostui/lib/ -l fdtuimgw

Under GNU/Linux, substitute c++ with i686-w64-mingw32-g++.

Wine emulator can be used to run the application.

wine wineconsole ./hello

Visual Studio

Visual Studio command line tools can be used to build FDOSTUI library. Set the command line environment using the "vcvarsall.bat" batch file. The batch file is located in the Visual Studio VC directory. For example, in Visual Studio 12, you would enter the following commands:

cd C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
vcvarsall.bat

To compile, change into the makevs directory of FDOSTUI, and type "nmake."

cd \source\fdostui\make
nmake /F vs.mak

The above command will build the object files and library. The object files are placed in the "..\obj\vs32" directory and library "fdtuivs.lib" in the "..\lib" directory.

Applications

Flags

/D__FLAT__ /D__NT__

Compiling

cl /c /D__FLAT__ /D__NT__ /I \source\fdostui\include hello.cpp

Linking

link hello.obj \source\fdostui\lib\fdtuivs.lib

ncurses

The library can be compiled for GNU/Linux and BSD operating systems using the curses library.

To compile, change into the makedirectory of FDOSTUI, and type "make -f ncur.mak." The makeile is compatible with both GNU and BSD make.

cd ~/source/fdostui/make
make -f ncur.mak

The above command will build the object files and library. The object files are placed in the "../obj/ncur" directory and library "libfdtuicur.a" in the "../lib" directory.

Applications

Flags

-D__FLAT__ -D__CURSES__

Compiling

c++ -c -D__FLAT__ -D__CURSES__ -I ~/source/fdostui/include hello.cpp

Linking

c++ -o hello hello.o -L ~/source/fdostui/lib/ -l fdtuicur -l curses