This section contains a number of examples of using the GNAT binding
Hello(source program in hello.adb) is bound using the standard switch settings. The generated main program is b~hello.adb. This is the normal, default use of the binder.
gnatbind hello -o mainprog.adb
Hello(source program in hello.adb) is bound using the standard switch settings. The generated main program is mainprog.adb with the associated spec in mainprog.ads. Note that you must specify the body here not the spec, in the case where the output is in Ada. Note that if this option is used, then linking must be done manually, since gnatlink will not be able to find the generated file.
gnatbind main -C -o mainprog.c -x
Main(source program in main.adb) is bound, excluding source files from the consistency checking, generating the file mainprog.c.
gnatbind -x main_program -C -o mainprog.c
gnatbind -n math dbase -C -o ada-control.c
Dbaseappear. This call to
gnatbindgenerates the file ada-control.c containing the
adafinalroutines to be called before and after accessing the Ada units.