WINDRES(1)

πŸ“¦ version 2.22~msp20120406, in ubuntu jammy

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

okay bestie, gather round β€” this is the page for windres, one of the GNU Development Tools. It's giving resource-wrangling icon behavior, and yes, you're gonna understand all of it. πŸŽ€


✨ NAME ✨

windres β€” manipulate Windows resources. πŸͺŸπŸ’…


✨ SYNOPSIS ✨

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

That's it. That's the whole vibe. Options first, then optionally an input file, then optionally an output file. πŸ¦‹


✨ DESCRIPTION ✨

So like, windres reads resources from an input file and copies them into an output file. Copy-paste but make it resource-y. Either one of those files can be in one of three formats:

  • 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 pointing you at Redmond for the lore πŸ™ˆ)

When windres converts from the rc format to the res format, it is acting like the Windows Resource Compiler. When windres converts from the res format to the coff format, it is acting like the Windows CVTRES program. Versatile queen. πŸ‘‘

When windres generates an rc file, the output is similar but not identical to the format expected for the input. And here's the tea: when an input rc file refers to an external filename, an output rc file will instead include the file contents. πŸ«–βœ¨ (it inlines it, bestie β€” the reference becomes the whole thing)

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 guessing rules, fr fr:

  • a file with an extension of .rc will be treated as an rc file πŸŽ€
  • a file with an extension of .res will be treated as a res file πŸŽ€
  • a file with an extension of .o or .exe will be treated as a coff file πŸŽ€

If no output file is specified, windres will print the resources in rc format to standard output. to your terminal, like a little gift 🎁

The normal use 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. This will make the resources described in the rc file available to Windows. That's the whole main character arc: write .rc β†’ windres β†’ .o β†’ link β†’ ✨ resources ✨.


✨ OPTIONS ✨

Every single flag, no skips, no crumbs. Let's get into it. πŸ’…

  • -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. > ⚠️ Heads up bestie: windres can not read a COFF file from standard input. That's a no. πŸ’€
  • -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. > ⚠️ And windres can not write a COFF file to standard output either. Note, for compatibility with rc the option -fo is also accepted, but its use is not recommended. (legacy behavior, 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 will guess, 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 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. 🎯
  • --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, including any leading arguments. The default preprocessor argument is gcc -E -xc-header -DRC_INVOKED. that's the default, word for word, don't come for me 🧚
  • -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. > 🚨 Deprecation tea: 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. iykyk πŸ’…
  • -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. literally just vibing there πŸ›‹οΈ
  • -v β€” enable verbose mode. This tells you what the preprocessor is if you didn't specify one. πŸ—£οΈ
  • -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. 🌐
  • -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. πŸ—ΊοΈ
  • --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). > yeah, that's a real bug that existed. wild. πŸ’€
  • --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. πŸ”¬ (only if it was compiled that way, bestie β€” otherwise it's just a lil ghost)
  • @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 files all the way down πŸŒ€


✨ SEE ALSO ✨

  • the Info entries for binutils. πŸ“š

Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 page, bestie! This little masterpiece came from binutils-2.21.1, dated 2011-06-27, and it's a WINDRES(1) situation through and through. Slay, go compile something iconic. πŸ‘‘βœ¨πŸ’…

πŸ“¦ where this page comes from