Compiling Resources (GNAT User’s Guide for Native Platforms)

#### 7.4.8.22 Compiling Resources ¶

This section describes how you can build a GNAT-compatible (COFF) object file containing the resources. You do this using the Resource Compiler `windres` as follows:

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

By default `windres` runs `gcc` to preprocess the `.rc` file. You can specify an alternate preprocessor (usually named `cpp.exe`) using the `windres` `--preprocessor` parameter. You can obtain a list of all possible switches by entering the command `windres` `--help`.

You can also 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