7.4.8.11 Building DLLs with GNAT

This section explains how to build DLLs using the GNAT built-in DLL support. With the following procedure, it is straightforward to build and use DLLs with GNAT.

At this point, you can use the DLL by directly linking against it. Note that you must use the GNAT shared runtime when using GNAT shared libraries. You do this with the -shared binder switch.

$ gnatmake main -Iapilib -bargs -shared -largs -Lapilib -lAPI