Next: , Previous: Building Resources, Up: GNAT and Windows Resources


9.3.5.22 Compiling Resources

This section describes how to build a GNAT-compatible (COFF) object file containing the resources. This is done using the Resource Compiler windres as follows:

    $ windres -i myres.rc -o myres.o

By default windres will run `gcc' to preprocess the .rc file. You can specify an alternate preprocessor (usually named cpp.exe) using the windres `–preprocessor' parameter. A list of all possible options may be obtained by entering the command windres `–help'.

It is also possible to use the Microsoft resource compiler rc.exe to produce a .res file (binary resource file). See the corresponding Microsoft documentation for further details. In this case you need to use windres to translate the .res file to a GNAT-compatible object file as follows:

    $ windres -i myres.res -o myres.o