WINDRES(1)

πŸ“¦
version 2.44 Β· 3 versions
, in debian trixie

πŸ’– WINDRES(1) πŸ’–

okay bestie, gather round, because today we're talking about windres β€” the GNU Development Tools girlie whose whole job is manipulating Windows resources. Yes, that kind of resource. Sit down, hydrate, let's go 🫢


✨ NAME ✨

windres β€” manipulate Windows resources. that's it, that's the whole vibe. iconic behaviour honestly πŸ‘‘


🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: windres reads resources from an input file and copies them into an output file. and like, either one of those files can be in one of three formats. three. a whole trio. πŸ’…

  • rc β€” a text format read by the Resource Compiler.
  • res β€” a binary format generated by the Resource Compiler.
  • coff β€” a COFF object or executable.

The exact description of these different formats is available in documentation from Microsoft. (not me sending you to Microsoft docs but here we are πŸ™ˆ)

When windres converts from the rc format to the res format, it is acting like the Windows Resource Compiler. and when it converts from the res format to the coff format, it is acting like the Windows CVTRES program. cosplay queen fr fr ✨

When windres generates an rc file, the output is similar but not identical to the format expected for the input. and get this β€” when an input rc file refers to an external filename, an output rc file will instead include the file contents. no external reference, just the whole thing inlined. it's giving "i brought the whole snack, not just the recipe" πŸ“

If the input or output format is not specified, windres will guess based on the file name, or, for the input file, the file contents. the detective work is real πŸ”

  • 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

If no output file is specified, windres will print the resources in rc format to standard output. straight to stdout, no filter, main character energy πŸ’…

The normal use β€” and bestie this is the whole point β€” is for you to write an rc file, use windres to convert it to a COFF object file, and then link the COFF file into your application. that will make the resources described in the rc file available to Windows. slay πŸ”₯


πŸ’… OPTIONS πŸ’…

  • -i filename, --input filename β€” the name of the input file. if this option is not used, then windres will use the first non-option argument as the input file name. if there are no non-option arguments, then windres will read from standard input. BUT β€” windres can not read a COFF file from standard input. so don't try it. i'm serious. 😀
  • -o filename, --output filename β€” the name of the output file. if this option is not used, then windres 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 windres will write to standard output. 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. lowkey deprecated energy, we don't do that here 🚫
  • -J format, --input-format format β€” the input format to read. format may be res, rc, or coff. if no input format is specified, windres will guess, as described above. mystery-solving era πŸ”
  • -O format, --output-format format β€” the output format to generate. format may be res, rc, or coff. if no output format is specified, windres will guess, 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 will use the default format, which is the first one listed by the --help option. first place wins, as always πŸ‘‘
  • --preprocessor program β€” when windres reads an rc file, it runs it through the C preprocessor first. this option may be used to specify the preprocessor to use. the default preprocessor is gcc. default is gcc bestie, that's the lore 🌈
  • --preprocessor-arg option β€” when windres reads an rc file, it runs it through the C preprocessor first. this option may be used to specify additional text to be passed to preprocessor on its command line. this option can be used 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. these default arguments are -E, -xc-header and -DRC_INVOKED. stack them, spam them, do your thing πŸ’…
  • -I directory, --include-dir directory β€” specify an include directory to use when reading an rc file. windres will pass this to the preprocessor as an -I option. windres will also search this directory when looking for files named in the rc file.
⚠️ WARNING 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. if a directory happens to match a format, simply prefix it with ./ to disable the backward compatibility. don't be messy, prefix it. πŸ™
  • -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. it's just there, vibing, doing nothing. respect 🫑
  • -v β€” enable verbose mode. this tells you what the preprocessor is if you didn't specify one. gossip mode: activated πŸ’¬
  • -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, it's a vibe check situation 🧚
  • -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-splitting math, we love to see it πŸ’œ
  • --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 the console). windows 95/98 girlies, this one's for you 😭
  • --no-use-temp-file β€” use popen, not a temporary file, to read the output of the preprocessor. this is the default behaviour. default queen πŸ‘‘
  • -h, --help β€” prints a usage summary. when in doubt, -h it out πŸŽ€
  • -V, --version β€” prints the version number for windres. ✨
  • --yydebug β€” if windres is compiled with YYDEBUG defined as 1, this will turn on parser debugging. nerdy AND cute πŸ”¬
  • @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. so it just sits there, being a little string. it's fine. it's fine!! πŸ’€

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. file-ception, we love her πŸŒ€


🌈 SEE ALSO 🌈

  • the Info entries for binutils.

Copyright (c) 1991-2025 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 was binutils-2.44, dated 2025-03-28, and honestly? she ate. periodt. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from