1<html lang="en"> 2<head> 3<title>windres - GNU Binary Utilities</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="GNU Binary Utilities"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="prev" href="nlmconv.html#nlmconv" title="nlmconv"> 9<link rel="next" href="windmc.html#windmc" title="windmc"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 132000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 14Free Software Foundation, Inc. 15 16Permission is granted to copy, distribute and/or modify this document 17under the terms of the GNU Free Documentation License, Version 1.3 18or any later version published by the Free Software Foundation; 19with no Invariant Sections, with no Front-Cover Texts, and with no 20Back-Cover Texts. A copy of the license is included in the 21section entitled ``GNU Free Documentation License''. 22 23--> 24<meta http-equiv="Content-Style-Type" content="text/css"> 25<style type="text/css"><!-- 26 pre.display { font-family:inherit } 27 pre.format { font-family:inherit } 28 pre.smalldisplay { font-family:inherit; font-size:smaller } 29 pre.smallformat { font-family:inherit; font-size:smaller } 30 pre.smallexample { font-size:smaller } 31 pre.smalllisp { font-size:smaller } 32 span.sc { font-variant:small-caps } 33 span.roman { font-family:serif; font-weight:normal; } 34 span.sansserif { font-family:sans-serif; font-weight:normal; } 35--></style> 36<link rel="stylesheet" type="text/css" href="../cs.css"> 37</head> 38<body> 39<div class="node"> 40<a name="windres"></a> 41<p> 42Next: <a rel="next" accesskey="n" href="windmc.html#windmc">windmc</a>, 43Previous: <a rel="previous" accesskey="p" href="nlmconv.html#nlmconv">nlmconv</a>, 44Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a> 45<hr> 46</div> 47 48<h2 class="chapter">13 windres</h2> 49 50<p><samp><span class="command">windres</span></samp> may be used to manipulate Windows resources. 51 52 <blockquote> 53<em>Warning:</em> <samp><span class="command">windres</span></samp> is not always built as part of the binary 54utilities, since it is only useful for Windows targets. 55</blockquote> 56 57<!-- man title windres manipulate Windows resources. --> 58<pre class="smallexample"> <!-- man begin SYNOPSIS windres --> 59 windres [options] [input-file] [output-file] 60 <!-- man end --> 61</pre> 62 <!-- man begin DESCRIPTION windres --> 63 <p><samp><span class="command">windres</span></samp> reads resources from an input file and copies them into 64an output file. Either file may be in one of three formats: 65 66 <dl> 67<dt><code>rc</code><dd>A text format read by the Resource Compiler. 68 69 <br><dt><code>res</code><dd>A binary format generated by the Resource Compiler. 70 71 <br><dt><code>coff</code><dd>A COFF object or executable. 72</dl> 73 74 <p>The exact description of these different formats is available in 75documentation from Microsoft. 76 77 <p>When <samp><span class="command">windres</span></samp> converts from the <code>rc</code> format to the <code>res</code> 78format, it is acting like the Windows Resource Compiler. When 79<samp><span class="command">windres</span></samp> converts from the <code>res</code> format to the <code>coff</code> 80format, it is acting like the Windows <code>CVTRES</code> program. 81 82 <p>When <samp><span class="command">windres</span></samp> generates an <code>rc</code> file, the output is similar 83but not identical to the format expected for the input. When an input 84<code>rc</code> file refers to an external filename, an output <code>rc</code> file 85will instead include the file contents. 86 87 <p>If the input or output format is not specified, <samp><span class="command">windres</span></samp> will 88guess based on the file name, or, for the input file, the file contents. 89A file with an extension of <samp><span class="file">.rc</span></samp> will be treated as an <code>rc</code> 90file, a file with an extension of <samp><span class="file">.res</span></samp> will be treated as a 91<code>res</code> file, and a file with an extension of <samp><span class="file">.o</span></samp> or 92<samp><span class="file">.exe</span></samp> will be treated as a <code>coff</code> file. 93 94 <p>If no output file is specified, <samp><span class="command">windres</span></samp> will print the resources 95in <code>rc</code> format to standard output. 96 97 <p>The normal use is for you to write an <code>rc</code> file, use <samp><span class="command">windres</span></samp> 98to convert it to a COFF object file, and then link the COFF file into 99your application. This will make the resources described in the 100<code>rc</code> file available to Windows. 101 102<!-- man end --> 103<!-- man begin OPTIONS windres --> 104 <dl> 105<dt><samp><span class="env">-i </span><var>filename</var></samp><dt><samp><span class="env">--input </span><var>filename</var></samp><dd>The name of the input file. If this option is not used, then 106<samp><span class="command">windres</span></samp> will use the first non-option argument as the input file 107name. If there are no non-option arguments, then <samp><span class="command">windres</span></samp> will 108read from standard input. <samp><span class="command">windres</span></samp> can not read a COFF file from 109standard input. 110 111 <br><dt><samp><span class="env">-o </span><var>filename</var></samp><dt><samp><span class="env">--output </span><var>filename</var></samp><dd>The name of the output file. If this option is not used, then 112<samp><span class="command">windres</span></samp> will use the first non-option argument, after any used 113for the input file name, as the output file name. If there is no 114non-option argument, then <samp><span class="command">windres</span></samp> will write to standard output. 115<samp><span class="command">windres</span></samp> can not write a COFF file to standard output. Note, 116for compatibility with <samp><span class="command">rc</span></samp> the option <samp><span class="option">-fo</span></samp> is also 117accepted, but its use is not recommended. 118 119 <br><dt><samp><span class="env">-J </span><var>format</var></samp><dt><samp><span class="env">--input-format </span><var>format</var></samp><dd>The input format to read. <var>format</var> may be ‘<samp><span class="samp">res</span></samp>’, ‘<samp><span class="samp">rc</span></samp>’, or 120‘<samp><span class="samp">coff</span></samp>’. If no input format is specified, <samp><span class="command">windres</span></samp> will 121guess, as described above. 122 123 <br><dt><samp><span class="env">-O </span><var>format</var></samp><dt><samp><span class="env">--output-format </span><var>format</var></samp><dd>The output format to generate. <var>format</var> may be ‘<samp><span class="samp">res</span></samp>’, 124‘<samp><span class="samp">rc</span></samp>’, or ‘<samp><span class="samp">coff</span></samp>’. If no output format is specified, 125<samp><span class="command">windres</span></samp> will guess, as described above. 126 127 <br><dt><samp><span class="env">-F </span><var>target</var></samp><dt><samp><span class="env">--target </span><var>target</var></samp><dd>Specify the BFD format to use for a COFF file as input or output. This 128is a BFD target name; you can use the <samp><span class="option">--help</span></samp> option to see a list 129of supported targets. Normally <samp><span class="command">windres</span></samp> will use the default 130format, which is the first one listed by the <samp><span class="option">--help</span></samp> option. 131<a href="Target-Selection.html#Target-Selection">Target Selection</a>. 132 133 <br><dt><samp><span class="env">--preprocessor </span><var>program</var></samp><dd>When <samp><span class="command">windres</span></samp> reads an <code>rc</code> file, it runs it through the C 134preprocessor first. This option may be used to specify the preprocessor 135to use, including any leading arguments. The default preprocessor 136argument is <code>gcc -E -xc-header -DRC_INVOKED</code>. 137 138 <br><dt><samp><span class="env">--preprocessor-arg </span><var>option</var></samp><dd>When <samp><span class="command">windres</span></samp> reads an <code>rc</code> file, it runs it through 139the C preprocessor first. This option may be used to specify additional 140text to be passed to preprocessor on its command line. 141This option can be used multiple times to add multiple options to the 142preprocessor command line. 143 144 <br><dt><samp><span class="env">-I </span><var>directory</var></samp><dt><samp><span class="env">--include-dir </span><var>directory</var></samp><dd>Specify an include directory to use when reading an <code>rc</code> file. 145<samp><span class="command">windres</span></samp> will pass this to the preprocessor as an <samp><span class="option">-I</span></samp> 146option. <samp><span class="command">windres</span></samp> will also search this directory when looking for 147files named in the <code>rc</code> file. If the argument passed to this command 148matches any of the supported <var>formats</var> (as described in the <samp><span class="option">-J</span></samp> 149option), it will issue a deprecation warning, and behave just like the 150<samp><span class="option">-J</span></samp> option. New programs should not use this behaviour. If a 151directory happens to match a <var>format</var>, simple prefix it with ‘<samp><span class="samp">./</span></samp>’ 152to disable the backward compatibility. 153 154 <br><dt><samp><span class="env">-D </span><var>target</var></samp><dt><samp><span class="env">--define </span><var>sym</var><span class="env">[=</span><var>val</var><span class="env">]</span></samp><dd>Specify a <samp><span class="option">-D</span></samp> option to pass to the preprocessor when reading an 155<code>rc</code> file. 156 157 <br><dt><samp><span class="env">-U </span><var>target</var></samp><dt><samp><span class="env">--undefine </span><var>sym</var></samp><dd>Specify a <samp><span class="option">-U</span></samp> option to pass to the preprocessor when reading an 158<code>rc</code> file. 159 160 <br><dt><samp><span class="env">-r</span></samp><dd>Ignored for compatibility with rc. 161 162 <br><dt><samp><span class="env">-v</span></samp><dd>Enable verbose mode. This tells you what the preprocessor is if you 163didn't specify one. 164 165 <br><dt><samp><span class="env">-c </span><var>val</var></samp><br><dt><samp><span class="env">--codepage </span><var>val</var></samp><dd>Specify the default codepage to use when reading an <code>rc</code> file. 166<var>val</var> should be a hexadecimal prefixed by ‘<samp><span class="samp">0x</span></samp>’ or decimal 167codepage code. The valid range is from zero up to 0xffff, but the 168validity of the codepage is host and configuration dependent. 169 170 <br><dt><samp><span class="env">-l </span><var>val</var></samp><br><dt><samp><span class="env">--language </span><var>val</var></samp><dd>Specify the default language to use when reading an <code>rc</code> file. 171<var>val</var> should be a hexadecimal language code. The low eight bits are 172the language, and the high eight bits are the sublanguage. 173 174 <br><dt><samp><span class="env">--use-temp-file</span></samp><dd>Use a temporary file to instead of using popen to read the output of 175the preprocessor. Use this option if the popen implementation is buggy 176on the host (eg., certain non-English language versions of Windows 95 and 177Windows 98 are known to have buggy popen where the output will instead 178go the console). 179 180 <br><dt><samp><span class="env">--no-use-temp-file</span></samp><dd>Use popen, not a temporary file, to read the output of the preprocessor. 181This is the default behaviour. 182 183 <br><dt><samp><span class="env">-h</span></samp><br><dt><samp><span class="env">--help</span></samp><dd>Prints a usage summary. 184 185 <br><dt><samp><span class="env">-V</span></samp><br><dt><samp><span class="env">--version</span></samp><dd>Prints the version number for <samp><span class="command">windres</span></samp>. 186 187 <br><dt><samp><span class="env">--yydebug</span></samp><dd>If <samp><span class="command">windres</span></samp> is compiled with <code>YYDEBUG</code> defined as <code>1</code>, 188this will turn on parser debugging. 189</dl> 190 191<!-- man end --> 192 </body></html> 193 194