WINDRES(1)

๐Ÿ“ฆ version 2.47, in arch rolling

๐Ÿ’… 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: when windres generates an rc file, the output is similar but not identical to the format expected for the input. and when an input rc file refers to an external filename, an output rc file 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 an rc file
  • a file with an extension of .res โ†’ treated as a res file
  • a file with an extension of .o or .exe โ†’ treated as a coff file

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, windres will 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: windres can 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, windres will 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: windres can not write a COFF file to standard output. also, for compatibility with rc, the option -fo is 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 be res, rc, or coff. if no input format is specified, windres guesses, as described above ๐Ÿ”ฎ
  • -O format, --output-format format โ€” the output format to generate. format may be res, rc, or coff. if no output format is specified, windres guesses, 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 --help option to see a list of supported targets. normally windres uses the default format, which is the first one listed by the --help option. first place = default, iykyk ๐Ÿ‘‘
  • --preprocessor program โ€” when windres reads an rc file, she runs it through the C preprocessor first. this option lets you specify which preprocessor to use. the default preprocessor is gcc. ๐Ÿ’–
  • --preprocessor-arg option โ€” same deal: when reading an rc file, 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 --preprocessor option has not been specified then a default set of preprocessor arguments will be used, with any --preprocessor-arg options being placed after them on the command line. those default arguments are -E, -xc-header and -DRC_INVOKED. noted, memorised, periodt.
  • -I directory, --include-dir directory โ€” specify an include directory to use when reading an rc file. windres passes this to the preprocessor as an -I option. she'll also search this directory when looking for files named in the rc file. ๐Ÿ‘€ BUT: if the argument passed to this command matches any of the supported formats (as described in the -J option), it will issue a deprecation warning, and behave just like the -J option. 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 -D option to pass to the preprocessor when reading an rc file. ๐ŸŒธ
  • -U target, --undefine sym โ€” specify a -U option to pass to the preprocessor when reading an rc file. ๐Ÿงš
  • -r โ€” ignored for compatibility with rc. 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 an rc file. val should be a hexadecimal prefixed by 0x or decimal codepage code. the valid range is from zero up to 0xffff, 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 an rc file. 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 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 to the console). ๐Ÿšจ real bug alert, take notes
  • --no-use-temp-file โ€” use popen, 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 for windres. ๐Ÿ’…
  • --yydebug โ€” if windres is compiled with YYDEBUG defined as 1, 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 @file option. 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 (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