General Rules

This section describes some general considerations to keep in mind for compiling and linking On Time RTOS-32 applications.

On Time RTOS-32 .EXE and .DLL files are Win32 Console Mode executables and are compiled and linked as such.

The startup code and run-time libraries for Win32 Console applications supplied with the supported compilers are used in unmodified form.

If you do not intend to use the compiler supplied run-time system (for example, to save memory), RTTarget-32's custom startup code C0rtt (for EXE files) or C0rttd.obj (for DLLs) is used as a replacement for the compiler-supplied startup code. This option is not available for Delphi programs. RTTarget-32's custom startup code is not compatible with the run-time systems and cannot be used if you need the run-time system.

An application consists of a single .EXE. In addition, it can use up to 63 DLLs.

With the exception of Rttheap.lib, the On Time RTOS-32 libraries must be linked to one and only one EXE or DLL of the application (the system module). All required On Time RTOS-32 libraries must reside in the same EXE or DLL.

EXEs or DLLs which do not contain On Time RTOS-32 libraries and which do not need access to the On Time RTOS-32 native APIs are compiled and linked exactly as standard Win32 Console Mode modules. They can execute unmodified both under Win32 and On Time RTOS-32. No On Time RTOS-32 specific libraries need to be linked.

EXEs or DLLs which do not contain On Time RTOS-32 libraries, but do need to access the On Time RTOS-32 native API can call such functions if

the EXE or DLL containing On Time RTOS-32 exports the required API functions;

they #define RTT32DLL before including Rttarget.h or other On Time RTOS-32 header files.

they link an import library of the EXE or DLL containing the On Time RTOS-32 libraries.

Delphi programs always use import units to access the On Time RTOS-32 native APIs contained in Rtt32dll.dll or a custom built System DLL.