This section describes a common case of mixed GNAT/Microsoft Visual Studio application development, where the main program is developed using MSVS, and is linked with a DLL developed using GNAT. Such a mixed application should be developed following the general guidelines outlined above; below is the cookbook-style sequence of steps to follow:
mylib.gpr, producing the library
$ gprbuild -p mylib.gpr
$ dlltool libmylib.dll -z libmylib.def --export-all-symbols
$ lib -machine:IX86 -def:libmylib.def -out:libmylib.lib
If you are using a 64-bit toolchain, the above becomes...
$ lib -machine:X64 -def:libmylib.def -out:libmylib.lib
$ cl /O2 /MD main.c libmylib.lib