1WINDRES(1) GNU Development Tools WINDRES(1)
2
3
4
6 windres - manipulate Windows resources
7
9 windres [options] [input-file] [output-file]
10
12 windres reads resources from an input file and copies them into an
13 output file. Either file may be in one of three formats:
14
15 "rc"
16 A text format read by the Resource Compiler.
17
18 "res"
19 A binary format generated by the Resource Compiler.
20
21 "coff"
22 A COFF object or executable.
23
24 The exact description of these different formats is available in
25 documentation from Microsoft.
26
27 When windres converts from the "rc" format to the "res" format, it is
28 acting like the Windows Resource Compiler. When windres converts from
29 the "res" format to the "coff" format, it is acting like the Windows
30 "CVTRES" program.
31
32 When windres generates an "rc" file, the output is similar but not
33 identical to the format expected for the input. When an input "rc"
34 file refers to an external filename, an output "rc" file will instead
35 include the file contents.
36
37 If the input or output format is not specified, windres will guess
38 based on the file name, or, for the input file, the file contents. A
39 file with an extension of .rc will be treated as an "rc" file, a file
40 with an extension of .res will be treated as a "res" file, and a file
41 with an extension of .o or .exe will be treated as a "coff" file.
42
43 If no output file is specified, windres will print the resources in
44 "rc" format to standard output.
45
46 The normal use is for you to write an "rc" file, use windres to convert
47 it to a COFF object file, and then link the COFF file into your
48 application. This will make the resources described in the "rc" file
49 available to Windows.
50
52 -i filename
53 --input filename
54 The name of the input file. If this option is not used, then
55 windres will use the first non-option argument as the input file
56 name. If there are no non-option arguments, then windres will read
57 from standard input. windres can not read a COFF file from
58 standard input.
59
60 -o filename
61 --output filename
62 The name of the output file. If this option is not used, then
63 windres will use the first non-option argument, after any used for
64 the input file name, as the output file name. If there is no non-
65 option argument, then windres will write to standard output.
66 windres can not write a COFF file to standard output. Note, for
67 compatibility with rc the option -fo is also accepted, but its use
68 is not recommended.
69
70 -J format
71 --input-format format
72 The input format to read. format may be res, rc, or coff. If no
73 input format is specified, windres will guess, as described above.
74
75 -O format
76 --output-format format
77 The output format to generate. format may be res, rc, or coff. If
78 no output format is specified, windres will guess, as described
79 above.
80
81 -F target
82 --target target
83 Specify the BFD format to use for a COFF file as input or output.
84 This is a BFD target name; you can use the --help option to see a
85 list of supported targets. Normally windres will use the default
86 format, which is the first one listed by the --help option.
87
88 --preprocessor program
89 When windres reads an "rc" file, it runs it through the C
90 preprocessor first. This option may be used to specify the
91 preprocessor to use, including any leading arguments. The default
92 preprocessor argument is "gcc -E -xc-header -DRC_INVOKED".
93
94 --preprocessor-arg option
95 When windres reads an "rc" file, it runs it through the C
96 preprocessor first. This option may be used to specify additional
97 text to be passed to preprocessor on its command line. This option
98 can be used multiple times to add multiple options to the
99 preprocessor command line.
100
101 -I directory
102 --include-dir directory
103 Specify an include directory to use when reading an "rc" file.
104 windres will pass this to the preprocessor as an -I option.
105 windres will also search this directory when looking for files
106 named in the "rc" file. If the argument passed to this command
107 matches any of the supported formats (as described in the -J
108 option), it will issue a deprecation warning, and behave just like
109 the -J option. New programs should not use this behaviour. If a
110 directory happens to match a format, simple prefix it with ./ to
111 disable the backward compatibility.
112
113 -D target
114 --define sym[=val]
115 Specify a -D option to pass to the preprocessor when reading an
116 "rc" file.
117
118 -U target
119 --undefine sym
120 Specify a -U option to pass to the preprocessor when reading an
121 "rc" file.
122
123 -r Ignored for compatibility with rc.
124
125 -v Enable verbose mode. This tells you what the preprocessor is if
126 you didn't specify one.
127
128 -c val
129 --codepage val
130 Specify the default codepage to use when reading an "rc" file. val
131 should be a hexadecimal prefixed by 0x or decimal codepage code.
132 The valid range is from zero up to 0xffff, but the validity of the
133 codepage is host and configuration dependent.
134
135 -l val
136 --language val
137 Specify the default language to use when reading an "rc" file. val
138 should be a hexadecimal language code. The low eight bits are the
139 language, and the high eight bits are the sublanguage.
140
141 --use-temp-file
142 Use a temporary file to instead of using popen to read the output
143 of the preprocessor. Use this option if the popen implementation is
144 buggy on the host (eg., certain non-English language versions of
145 Windows 95 and Windows 98 are known to have buggy popen where the
146 output will instead go the console).
147
148 --no-use-temp-file
149 Use popen, not a temporary file, to read the output of the
150 preprocessor. This is the default behaviour.
151
152 -h
153 --help
154 Prints a usage summary.
155
156 -V
157 --version
158 Prints the version number for windres.
159
160 --yydebug
161 If windres is compiled with "YYDEBUG" defined as 1, this will turn
162 on parser debugging.
163
164 @file
165 Read command-line options from file. The options read are inserted
166 in place of the original @file option. If file does not exist, or
167 cannot be read, then the option will be treated literally, and not
168 removed.
169
170 Options in file are separated by whitespace. A whitespace
171 character may be included in an option by surrounding the entire
172 option in either single or double quotes. Any character (including
173 a backslash) may be included by prefixing the character to be
174 included with a backslash. The file may itself contain additional
175 @file options; any such options will be processed recursively.
176
178 the Info entries for binutils.
179
181 Copyright (c) 1991-2020 Free Software Foundation, Inc.
182
183 Permission is granted to copy, distribute and/or modify this document
184 under the terms of the GNU Free Documentation License, Version 1.3 or
185 any later version published by the Free Software Foundation; with no
186 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
187 Texts. A copy of the license is included in the section entitled "GNU
188 Free Documentation License".
189
190
191
192binutils-2.34 2021-04-12 WINDRES(1)