7.4.7.11 Building DLLs with GNAT

This section explain how to build DLLs using the GNAT built-in DLL support. With the following procedure it is straight forward to build and use DLLs with GNAT.

At this point it is possible to use the DLL by directly linking against it. Note that you must use the GNAT shared runtime when using GNAT shared libraries. This is achieved by using the -shared binder option.

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