📄 windres.html
字号:
<html lang="en">
<head>
<title>GNU Binary Utilities</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Binary Utilities">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
</head>
<body>
<div class="node">
<p>
Node:<a name="windres">windres</a>,
Next:<a rel="next" accesskey="n" href="dlltool.html#dlltool">dlltool</a>,
Previous:<a rel="previous" accesskey="p" href="nlmconv.html#nlmconv">nlmconv</a>,
Up:<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr><br>
</div>
<h2 class="chapter">windres</h2>
<p><code>windres</code> may be used to manipulate Windows resources.
<blockquote>
<em>Warning:</em> <code>windres</code> is not always built as part of the binary
utilities, since it is only useful for Windows targets.
</blockquote>
<pre class="smallexample"> windres [options] [input-file] [output-file]
</pre>
<p><code>windres</code> reads resources from an input file and copies them into
an output file. Either file may be in one of three formats:
<dl>
<dt><code>rc</code>
<dd>A text format read by the Resource Compiler.
<br><dt><code>res</code>
<dd>A binary format generated by the Resource Compiler.
<br><dt><code>coff</code>
<dd>A COFF object or executable.
</dl>
<p>The exact description of these different formats is available in
documentation from Microsoft.
<p>When <code>windres</code> converts from the <code>rc</code> format to the <code>res</code>
format, it is acting like the Windows Resource Compiler. When
<code>windres</code> converts from the <code>res</code> format to the <code>coff</code>
format, it is acting like the Windows <code>CVTRES</code> program.
<p>When <code>windres</code> generates an <code>rc</code> file, the output is similar
but not identical to the format expected for the input. When an input
<code>rc</code> file refers to an external filename, an output <code>rc</code> file
will instead include the file contents.
<p>If the input or output format is not specified, <code>windres</code> will
guess based on the file name, or, for the input file, the file contents.
A file with an extension of <code>.rc</code> will be treated as an <code>rc</code>
file, a file with an extension of <code>.res</code> will be treated as a
<code>res</code> file, and a file with an extension of <code>.o</code> or
<code>.exe</code> will be treated as a <code>coff</code> file.
<p>If no output file is specified, <code>windres</code> will print the resources
in <code>rc</code> format to standard output.
<p>The normal use is for you to write an <code>rc</code> file, use <code>windres</code>
to convert it to a COFF object file, and then link the COFF file into
your application. This will make the resources described in the
<code>rc</code> file available to Windows.
<dl>
<dt><code>-i </code><var>filename</var><code></code>
<dd><dt><code>--input </code><var>filename</var><code></code>
<dd>The name of the input file. If this option is not used, then
<code>windres</code> will use the first non-option argument as the input file
name. If there are no non-option arguments, then <code>windres</code> will
read from standard input. <code>windres</code> can not read a COFF file from
standard input.
<br><dt><code>-o </code><var>filename</var><code></code>
<dd><dt><code>--output </code><var>filename</var><code></code>
<dd>The name of the output file. If this option is not used, then
<code>windres</code> will use the first non-option argument, after any used
for the input file name, as the output file name. If there is no
non-option argument, then <code>windres</code> will write to standard output.
<code>windres</code> can not write a COFF file to standard output.
<br><dt><code>-I </code><var>format</var><code></code>
<dd><dt><code>--input-format </code><var>format</var><code></code>
<dd>The input format to read. <var>format</var> may be <code>res</code>, <code>rc</code>, or
<code>coff</code>. If no input format is specified, <code>windres</code> will
guess, as described above.
<br><dt><code>-O </code><var>format</var><code></code>
<dd><dt><code>--output-format </code><var>format</var><code></code>
<dd>The output format to generate. <var>format</var> may be <code>res</code>,
<code>rc</code>, or <code>coff</code>. If no output format is specified,
<code>windres</code> will guess, as described above.
<br><dt><code>-F </code><var>target</var><code></code>
<dd><dt><code>--target </code><var>target</var><code></code>
<dd>Specify the BFD format to use for a COFF file as input or output. This
is a BFD target name; you can use the <code>--help</code> option to see a list
of supported targets. Normally <code>windres</code> will use the default
format, which is the first one listed by the <code>--help</code> option.
<a href="Target-Selection.html#Target%20Selection">Target Selection</a>.
<br><dt><code>--preprocessor </code><var>program</var><code></code>
<dd>When <code>windres</code> reads an <code>rc</code> file, it runs it through the C
preprocessor first. This option may be used to specify the preprocessor
to use, including any leading arguments. The default preprocessor
argument is <code>gcc -E -xc-header -DRC_INVOKED</code>.
<br><dt><code>--include-dir </code><var>directory</var><code></code>
<dd>Specify an include directory to use when reading an <code>rc</code> file.
<code>windres</code> will pass this to the preprocessor as an <code>-I</code>
option. <code>windres</code> will also search this directory when looking for
files named in the <code>rc</code> file.
<br><dt><code>-D </code><var>target</var><code></code>
<dd><dt><code>--define </code><var>sym</var><code>[=</code><var>val</var><code>]</code>
<dd>Specify a <code>-D</code> option to pass to the preprocessor when reading an
<code>rc</code> file.
<br><dt><code>-v</code>
<dd>Enable verbose mode. This tells you what the preprocessor is if you
didn't specify one.
<br><dt><code>--language </code><var>val</var><code></code>
<dd>Specify the default language to use when reading an <code>rc</code> file.
<var>val</var> should be a hexadecimal language code. The low eight bits are
the language, and the high eight bits are the sublanguage.
<br><dt><code>--use-temp-file</code>
<dd>Use a temporary file to instead of using popen to read the output of
the preprocessor. Use this option if the popen implementation is buggy
on the host (eg., certain non-English language versions of Windows 95 and
Windows 98 are known to have buggy popen where the output will instead
go the console).
<br><dt><code>--no-use-temp-file</code>
<dd>Use popen, not a temporary file, to read the output of the preprocessor.
This is the default behaviour.
<br><dt><code>--help</code>
<dd>Prints a usage summary.
<br><dt><code>--version</code>
<dd>Prints the version number for <code>windres</code>.
<br><dt><code>--yydebug</code>
<dd>If <code>windres</code> is compiled with <code>YYDEBUG</code> defined as <code>1</code>,
this will turn on parser debugging.
</dl>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -