F.1 Using GNAT on Windows
One of the strengths of the GNAT technology is that its tool set
(gcc, gnatbind, gnatlink, gnatmake, the
gdb
debugger, etc.) is used in the same way regardless of the
platform.
On Windows this tool set is complemented by a number of Microsoft-specific
tools that have been provided to facilitate interoperability with Windows
when this is required. With these tools:
- You can build applications using the
CONSOLE
or WINDOWS
subsystems.
- You can use any Dynamically Linked Library (DLL) in your Ada code (both
relocatable and non-relocatable DLLs are supported).
- You can build Ada DLLs for use in other applications. These applications
can be written in a language other than Ada (e.g., C, C++, etc). Again both
relocatable and non-relocatable Ada DLLs are supported.
- You can include Windows resources in your Ada application.
- You can use or create COM/DCOM objects.
Immediately below are listed all known general GNAT-for-Windows restrictions.
Other restrictions about specific features like Windows Resources and DLLs
are listed in separate sections below.
- It is not possible to use
GetLastError
and SetLastError
when tasking, protected records, or exceptions are used. In these
cases, in order to implement Ada semantics, the GNAT run-time system
calls certain Win32 routines that set the last error variable to 0 upon
success. It should be possible to use GetLastError
and
SetLastError
when tasking, protected record, and exception
features are not used, but it is not guaranteed to work.
- It is not possible to link against Microsoft libraries except for
import libraries. The library must be built to be compatible with
MSVCRT.LIB (/MD Microsoft compiler option), LIBC.LIB and
LIBCMT.LIB (/ML or /MT Microsoft compiler options) are known to
not be compatible with the GNAT runtime. Even if the library is
compatible with MSVCRT.LIB it is not guaranteed to work.
- When the compilation environment is located on FAT32 drives, users may
experience recompilations of the source files that have not changed if
Daylight Saving Time (DST) state has changed since the last time files
were compiled. NTFS drives do not have this problem.
- No components of the GNAT toolset use any entries in the Windows
registry. The only entries that can be created are file associations and
PATH settings, provided the user has chosen to create them at installation
time, as well as some minimal book-keeping information needed to correctly
uninstall or integrate different GNAT products.