WINDRES(1)
๐ WINDRES(1) โ manipulating Windows resources โจ
okay so this is windres, from the GNU Development Tools squad ๐ซถ โ it's the binutils bestie that handles Windows resources, and honestly? she's iconic.
โจ SYNOPSIS โจ
windres [options] [input-file] [output-file]
that's it. that's the whole vibe check. ๐
๐ธ DESCRIPTION ๐ธ
okay so listen ๐ โ windres reads resources from an input file and copies them into an output file. simple. chef's kiss. but here's the tea: either of those files can be in one of three formats, and you gotta know them:
rcโ a text format read by the Resource Compiler. it's giving "readable, texty, cute" ๐resโ a binary format generated by the Resource Compiler. mysterious. binary. lowkey scary ๐coffโ a COFF object or executable. main character energy, fr fr ๐
the exact description of these different formats lives in documentation from Microsoft. not our problem, go ask them ๐
so when windres converts from the rc format to the res format, she's literally cosplaying as the Windows Resource Compiler. and when she converts from res to coff, she's out here acting like the Windows CVTRES program. versatile queen. โจ
๐จ important lore: whenwindresgenerates anrcfile, the output is similar but not identical to the format expected for the input. and when an inputrcfile refers to an external filename, an outputrcfile will instead include the file contents. no cap, that's the behaviour.
if the input or output format isn't specified, windres will guess ๐ฎ โ based on the file name, or, for the input file, the file contents. the rules are:
- a file with an extension of
.rcโ treated as anrcfile - a file with an extension of
.resโ treated as aresfile - a file with an extension of
.oor.exeโ treated as acofffile
if no output file is specified, windres prints the resources in rc format to standard output. cute. ๐
and the normal use case, bestie, the one you'll actually do 99% of the time: you write an rc file โ you use windres to convert it to a COFF object file โ you link that COFF file into your application. boom. now the resources described in the rc file are available to Windows. slay. ๐ฅ
๐ฆ OPTIONS ๐ฆ
-i filename,--input filenameโ the name of the input file. if you don't use this option,windreswill use the first non-option argument as the input file name. if there are no non-option arguments at all, she reads from standard input. โ ๏ธ but heads up:windrescan not read a COFF file from standard input. sorry bestie, that's just how it is ๐ญ-o filename,--output filenameโ the name of the output file. if you don't use this option,windreswill use the first non-option argument, after any used for the input file name, as the output file name. if there's no non-option argument, she writes to standard output. โ ๏ธ and again:windrescan not write a COFF file to standard output. also, for compatibility withrc, the option-fois also accepted โ but its use is not recommended. deprecated-ish behaviour, we don't stan ๐-J format,--input-format formatโ the input format to read. format may beres,rc, orcoff. if no input format is specified,windresguesses, as described above ๐ฎ-O format,--output-format formatโ the output format to generate. format may beres,rc, orcoff. if no output format is specified,windresguesses, as described above ๐ฎ-F target,--target targetโ specify the BFD format to use for a COFF file as input or output. this is a BFD target name; you can use the--helpoption to see a list of supported targets. normallywindresuses the default format, which is the first one listed by the--helpoption. first place = default, iykyk ๐--preprocessor programโ whenwindresreads anrcfile, she runs it through the C preprocessor first. this option lets you specify which preprocessor to use. the default preprocessor isgcc. ๐--preprocessor-arg optionโ same deal: when reading anrcfile, it goes through the C preprocessor first, and this option specifies additional text to be passed to the preprocessor on its command line. you can use this option multiple times to add multiple options to the preprocessor command line. ๐ if the--preprocessoroption has not been specified then a default set of preprocessor arguments will be used, with any--preprocessor-argoptions being placed after them on the command line. those default arguments are-E,-xc-headerand-DRC_INVOKED. noted, memorised, periodt.-I directory,--include-dir directoryโ specify an include directory to use when reading anrcfile.windrespasses this to the preprocessor as an-Ioption. she'll also search this directory when looking for files named in thercfile. ๐ BUT: if the argument passed to this command matches any of the supported formats (as described in the-Joption), it will issue a deprecation warning, and behave just like the-Joption. new programs should not use this behaviour. if a directory happens to match a format, simply prefix it with./to disable the backward compatibility. ok that's a whole saga, but now you know ๐-D target,--define sym[=val]โ specify a-Doption to pass to the preprocessor when reading anrcfile. ๐ธ-U target,--undefine symโ specify a-Uoption to pass to the preprocessor when reading anrcfile. ๐ง-rโ ignored for compatibility withrc. she's just there. vibes only. ๐ซถ-vโ enable verbose mode. this tells you what the preprocessor is if you didn't specify one. very helpful, very demure โจ-c val,--codepage valโ specify the default codepage to use when reading anrcfile. val should be a hexadecimal prefixed by0xor decimal codepage code. the valid range is from zero up to0xffff, but the validity of the codepage is host and configuration dependent. so likeโฆ range is fine, whether it works is another story ๐ญ-l val,--language valโ specify the default language to use when reading anrcfile. val should be a hexadecimal language code. the low eight bits are the language, and the high eight bits are the sublanguage. bit math, we love her ๐--use-temp-fileโ use a temporary file instead of usingpopento read the output of the preprocessor. use this option if thepopenimplementation is buggy on the host (eg., certain non-English language versions of Windows 95 and Windows 98 are known to have buggypopenwhere the output will instead go to the console). ๐จ real bug alert, take notes--no-use-temp-fileโ usepopen, not a temporary file, to read the output of the preprocessor. this is the default behaviour. ๐-h,--helpโ prints a usage summary. ๐ซถ-V,--versionโ prints the version number forwindres. ๐--yydebugโ ifwindresis compiled withYYDEBUGdefined as1, this will turn on parser debugging. ๐ deep lore, only for the brave@fileโ read command-line options from file. the options read are inserted in place of the original@fileoption. if file does not exist, or cannot be read, then the option will be treated literally, and not removed. ๐
options in file are separated by whitespace. a whitespace character may be included in an option by surrounding the entire option in either single or double quotes. any character (including a backslash) may be included by prefixing the character to be included with a backslash. the file may itself contain additional @file options; any such options will be processed recursively. ๐คฏ inception behaviour, honestly
๐ SEE ALSO ๐
the Info entries for binutils. that's where the rest of the lore lives, bestie ๐โจ
๐ COPYRIGHT ๐
Copyright (c) 1991-2026 Free Software Foundation, Inc. ๐
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". ๐ซถ
and that's the whole page, bestie โ brought to you by binutils-2.47, dated 2026-07-30, from the WINDRES(1) girlies themselves. go manipulate some Windows resources, you absolute icon ๐๐
โจ
๐ฆ where this page comes from
- arch rolling: avr-binutils 2.47-1 ยท GPL
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms