WINDRES(1)

๐Ÿ“ฆ version 12.2.0, in nixpkgs unstable

๐Ÿ’… WINDRES(1) โ€” like, the windres manual but make it make sense ๐ŸŽ€

okay so bestie, welcome to windres(1), part of the GNU Development Tools fam. this is the little icon that manipulates Windows resources, and yes she ate. ๐Ÿฆ‹


โœจ NAME โœจ

windres โ€” manipulate Windows resources. that's it, that's the whole job, and she does it flawlessly. periodt. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

literally just options, an input file, an output file. optional-ish. we'll get there. ๐Ÿซถ


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

so windres reads resources from an input file and copies them into an output file. either file can be in one of three formats, and here's the vibe check on all three:

  • rc โ€” a text format read by the Resource Compiler. the readable one. the main character. โœจ
  • res โ€” a binary format generated by the Resource Compiler. crunchy but valid. ๐Ÿ’€
  • coff โ€” a COFF object or executable. the final form, iykyk.

the exact description of these different formats is available in documentation from Microsoft. (not my problem, go ask them ๐Ÿซถ)

when windres converts from the rc format to the res format, she's acting like the Windows Resource Compiler. when she converts from the res format to the coff format, she's acting like the Windows CVTRES program. cosplay queen โ€” she contains multitudes. ๐Ÿ‘‘

when windres generates an rc file, the output is similar but not identical to the format expected for the input. and listen: when an input rc file refers to an external filename, an output rc file will instead include the file contents. no cap, it inlines it. ๐Ÿ™ˆ

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 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 will print the resources in rc format to standard output. lowkey convenient. ๐ŸŒˆ

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 workflow bestie, that's the pipeline, 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. ๐Ÿ˜ญ
  • -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 either. also โ€” for compatibility with rc the option -fo is also accepted, but its use is not recommended. deprecated-ish era, 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 factory setting, bestie. ๐Ÿงš
  • --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. stack 'em. ๐Ÿ“
  • -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. heads up though โ€” 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, simple prefix it with ./ to disable the backward compatibility. ok that sentence says "simple prefix it" and I'm keeping it exactly as written, we don't edit the ancestors. ๐Ÿ™ˆ
  • -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 here, vibing, doing nothing. ghost member of the group chat. ๐Ÿ‘ป
  • -v โ€” enable verbose mode. this tells you what the preprocessor is if you didn't specify one. helpful bestie behaviour. โœจ
  • -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, in range โ‰  guaranteed valid. ๐Ÿ’€
  • -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 to 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). retro bug, retro fix. ๐Ÿ•ฐ๏ธ
  • --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. nerdy and I respect it. ๐Ÿ”ฌ
  • @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, bestie. ๐ŸŒ€


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

  • the Info entries for binutils.

go read them, they're giving lore. ๐Ÿ“š


Copyright (c) 1991-2018 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".


legal bestie moment: that license text above is the actual license text, do not come for me, I am simply the messenger. ๐Ÿ’œ

and that's the page! this whole thing is from binutils-2.30, dated 2018-01-27, and yes the page is literally named WINDRES(1) โ€” she's iconic, she's documented, she's done. mwah. ๐Ÿ’…๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from