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. The default preprocessor is "gcc".
92
93 --preprocessor-arg option
94 When windres reads an "rc" file, it runs it through the C
95 preprocessor first. This option may be used to specify additional
96 text to be passed to preprocessor on its command line. This option
97 can be used multiple times to add multiple options to the
98 preprocessor command line. If the --preprocessor option has not
99 been specified then a default set of preprocessor arguments will be
100 used, with any --preprocessor-arg options being placed after them
101 on the command line. These default arguments are "-E",
102 "-xc-header" and "-DRC_INVOKED".
103
104 -I directory
105 --include-dir directory
106 Specify an include directory to use when reading an "rc" file.
107 windres will pass this to the preprocessor as an -I option.
108 windres will also search this directory when looking for files
109 named in the "rc" file. If the argument passed to this command
110 matches any of the supported formats (as described in the -J
111 option), it will issue a deprecation warning, and behave just like
112 the -J option. New programs should not use this behaviour. If a
113 directory happens to match a format, simple prefix it with ./ to
114 disable the backward compatibility.
115
116 -D target
117 --define sym[=val]
118 Specify a -D option to pass to the preprocessor when reading an
119 "rc" file.
120
121 -U target
122 --undefine sym
123 Specify a -U option to pass to the preprocessor when reading an
124 "rc" file.
125
126 -r Ignored for compatibility with rc.
127
128 -v Enable verbose mode. This tells you what the preprocessor is if
129 you didn't specify one.
130
131 -c val
132 --codepage val
133 Specify the default codepage to use when reading an "rc" file. val
134 should be a hexadecimal prefixed by 0x or decimal codepage code.
135 The valid range is from zero up to 0xffff, but the validity of the
136 codepage is host and configuration dependent.
137
138 -l val
139 --language val
140 Specify the default language to use when reading an "rc" file. val
141 should be a hexadecimal language code. The low eight bits are the
142 language, and the high eight bits are the sublanguage.
143
144 --use-temp-file
145 Use a temporary file to instead of using popen to read the output
146 of the preprocessor. Use this option if the popen implementation is
147 buggy on the host (eg., certain non-English language versions of
148 Windows 95 and Windows 98 are known to have buggy popen where the
149 output will instead go the console).
150
151 --no-use-temp-file
152 Use popen, not a temporary file, to read the output of the
153 preprocessor. This is the default behaviour.
154
155 -h
156 --help
157 Prints a usage summary.
158
159 -V
160 --version
161 Prints the version number for windres.
162
163 --yydebug
164 If windres is compiled with "YYDEBUG" defined as 1, this will turn
165 on parser debugging.
166
167 @file
168 Read command-line options from file. The options read are inserted
169 in place of the original @file option. If file does not exist, or
170 cannot be read, then the option will be treated literally, and not
171 removed.
172
173 Options in file are separated by whitespace. A whitespace
174 character may be included in an option by surrounding the entire
175 option in either single or double quotes. Any character (including
176 a backslash) may be included by prefixing the character to be
177 included with a backslash. The file may itself contain additional
178 @file options; any such options will be processed recursively.
179
181 the Info entries for binutils.
182
184 Copyright (c) 1991-2023 Free Software Foundation, Inc.
185
186 Permission is granted to copy, distribute and/or modify this document
187 under the terms of the GNU Free Documentation License, Version 1.3 or
188 any later version published by the Free Software Foundation; with no
189 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
190 Texts. A copy of the license is included in the section entitled "GNU
191 Free Documentation License".
192
193
194
195binutils-2.40.00 2023-07-30 WINDRES(1)