WINDRES(1)

๐Ÿ“ฆ
version 2.46.1 ยท 5 versions
, in fedora 44

๐Ÿ’– WINDRES(1) โ€” manipulate Windows resources ๐Ÿ’–

okay bestie, sit down, hydrate, because today we're talking about windres from the GNU Development Tools girlies, and she is so much cooler than her name suggests. she moves Windows resources around like it's nothing. no cap. ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

windres [options] [input-file] [output-file]

that's it. that's the whole vibe. options go in, files go in, magic comes out the other side. ๐Ÿ’…


๐ŸŒธ DESCRIPTION ๐ŸŒธ

So here's the tea: windres reads resources from an input file and copies them into an output file. Either file can be in one of three formats, and honestly they each have their own little personality:

  • "rc" โ€” a text format that gets read by the Resource Compiler. she's the readable one. the girl who journals. ๐Ÿ““
  • "res" โ€” a binary format generated by the Resource Compiler. mysterious, opaque, does not explain herself.
  • "coff" โ€” a COFF object or executable. the final boss form.

if you want the exact description of these formats, go read Microsoft's documentation, because that's where the receipts live. ๐Ÿ”

when windres converts from "rc" to "res", she's basically cosplaying as the Windows Resource Compiler. and when she converts from "res" to "coff"? she's giving Windows "CVTRES" program energy. versatile queen. ๐Ÿ‘‘

now here's something lowkey important: when windres generates an "rc" file, the output is similar but not identical to the format expected for input. and specifically โ€” when an input "rc" file refers to an external filename, the output "rc" file will instead include the file contents. so if you were expecting a reference, bestie, you're getting the whole thing. it's giving "no thoughts, just paste." ๐Ÿ˜ญ

๐Ÿงš format guessing (she's psychic, kinda)

if you don't specify the input or output format, windres will guess based on the file name โ€” or, for the input file, on the file contents. the rules are:

  • a file with an extension of .rc gets treated as an "rc" file
  • a file with an extension of .res gets treated as a "res" file
  • a file with an extension of .o or .exe gets treated as a "coff" file

and if you specify no output file at all, she'll just print the resources in "rc" format straight to standard output. iconic. โœจ

๐ŸŽ€ the normal use case

the usual flow is: you write an "rc" file, you use windres to convert it into a COFF object file, and then you link that COFF file into your application. boom. now the resources described in the "rc" file are available to Windows. that's the whole plot. that's the movie. ๐Ÿ“


๐Ÿ’… 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.
  • -o filename, --output filename โ€” the name of the output file. if you don't use this option, windres uses 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 bestie, its use is not recommended. ๐Ÿšฉ
  • -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, and 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.
  • --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 โ€” again, when windres reads an "rc" file, she runs it through the C preprocessor first. 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 gets used, with any --preprocessor-arg options placed after them on the command line. those default arguments are "-E", "-xc-header" and "-DRC_INVOKED". ๐Ÿ“
  • -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, and she'll also search this directory when looking for files named in the "rc" file.
โš ๏ธ deprecation alert, bestie โš ๏ธ 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. and if a directory happens to match a format, just prefix it with ./ to disable the backward compatibility. problem solved. ๐Ÿ’โ€โ™€๏ธ
  • -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 standing there. existing. ๐Ÿงโ€โ™€๏ธ
  • -v โ€” enable verbose mode. this tells you what the preprocessor is, in case you didn't specify one. very "let me introduce you to my friend." ๐Ÿซถ
  • -c val, --codepage val โ€” specify the default codepage to use when reading an "rc" file. val should be a hexadecimal prefixed by 0x or a decimal codepage code. the valid range is from zero up to 0xffff, but whether a given codepage is actually valid depends on the host and configuration. so likeโ€ฆ it's giving "your mileage may vary." ๐ŸŒˆ
  • -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. split it down the middle, queen. ๐Ÿ‘‘
  • --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 โ€” for example, 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. ๐Ÿ˜ตโ€๐Ÿ’ซ retro problems require retro solutions.
  • --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. your girl is helpful. ๐ŸŽ€
  • -V, --version โ€” prints the version number for windres.
  • --yydebug โ€” if windres is compiled with "YYDEBUG" defined as 1, this turns on parser debugging. nerd mode: unlocked. ๐Ÿค“
  • @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. it's giving inception. ๐ŸŒ€


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • the Info entries for binutils.

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! this one's from binutils-2.46.1, dated 2026-09-07, and it's the WINDRES(1) manual through and through. go convert something. slay. ๐Ÿ’–โœจ
๐Ÿ“ฆ where this page comes from
  • fedora 44: cross-binutils-common 2.46.1-1.fc44 ยท GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms