WINDRES(1)
π WINDRES(1) β the windres manual, but make it make sense π
okay bestie, so you know that manual page called windres? that's the one. it lives in GNU Development Tools and it's genuinely iconic once you get past the manpage voice. let's go β¨
πΈ NAME πΈ
windres β manipulate Windows resources. that's it. that's the whole vibe. π
π¦ SYNOPSIS π¦
windres [options] [input-file] [output-file]
literally just options, then an input file, then an output file. you got this π«Ά
β¨ DESCRIPTION β¨
so windres reads resources from an input file and copies them into an output file. and either one of those files can be in any of three formats, no cap:
"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 (iykyk, go look it up π).
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. main character energy, honestly β it's just cosplaying other tools π
and when windres generates an "rc" file, the output is similar but not identical to the format expected for the input. specifically: when an input "rc" file refers to an external filename, an output "rc" file will instead include the file contents. so like, it inlines it. noted π
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. here's the cheat sheet:
- a file with an extension of
.rcwill be treated as an"rc"file - a file with an extension of
.reswill be treated as a"res"file - a file with an extension of
.oor.exewill be treated as a"coff"file
if no output file is specified, windres will print the resources in "rc" format to standard output. cute π
the normal use β the whole reason this thing exists β 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. slay π
π₯ OPTIONS π₯
-i filename,--input filenameβ the name of the input file. if this option is not used, thenwindreswill use the first non-option argument as the input file name. if there are no non-option arguments, thenwindreswill read from standard input. > β οΈwindrescan not read a COFF file from standard input. tragic but true π-o filename,--output filenameβ the name of the output file. if this option is not used, thenwindreswill 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, thenwindreswill write to standard output. > β οΈwindrescan not write a COFF file to standard output. also note, for compatibility withrcthe option-fois also accepted, but its use is not recommended. it's giving deprecated-adjacent, bestie π-J format,--input-format formatβ the input format to read. format may beres,rc, orcoff. if no input format is specified,windreswill guess, as described above.-O format,--output-format formatβ the output format to generate. format may beres,rc, orcoff. if no output format is specified,windreswill 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--helpoption to see a list of supported targets. normallywindreswill use the default format, which is the first one listed by the--helpoption. first place = default, periodt π--preprocessor programβ whenwindresreads 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 isgcc.--preprocessor-arg optionβ whenwindresreads 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--preprocessoroption has not been specified then a default set of preprocessor arguments will be used, with any--preprocessor-argoptions being placed after them on the command line. these default arguments are-E,-xc-headerand-DRC_INVOKED.-I directory,--include-dir directoryβ specify an include directory to use when reading an"rc"file.windreswill pass this to the preprocessor as an-Ioption.windreswill also search this directory when looking for files named in the"rc"file. > β οΈ lowkey a trap: if the argument passed to this command matches any of the supported formats (as described in the-Joption), it will issue a deprecation warning, and behave just like the-Joption. new programs should not use this behaviour. if a directory happens to match a format, simple prefix it with./to disable the backward compatibility. you've been warned bestie π-D target,--define sym[=val]β specify a-Doption to pass to the preprocessor when reading an"rc"file.-U target,--undefine symβ specify a-Uoption to pass to the preprocessor when reading an"rc"file.-rβ ignored for compatibility withrc. that's it, it does nothing, it's just here to be polite π-vβ enable verbose mode. this tells you what the preprocessor is if you didn't specify one. helpful! we love transparency β¨-c val,--codepage valβ specify the default codepage to use when reading an"rc"file. val should be a hexadecimal prefixed by0xor decimal codepage code. the valid range is from zero up to0xffff, but the validity of the codepage is host and configuration dependent. so like, in range β guaranteed valid, ngl π¦-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 usingpopento read the output of the preprocessor. use this option if thepopenimplementation is buggy on the host (eg., certain non-English language versions of Windows 95 and Windows 98 are known to have buggypopenwhere the output will instead go the console). yes that's a real sentence in the real manpage, we're keeping it fr fr π--no-use-temp-fileβ usepopen, 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 forwindres.--yydebugβ ifwindresis compiled with"YYDEBUG"defined as1, this will turn on parser debugging. if it wasn't compiled that way, this does nothing for you, sorry babe π«@fileβ read command-line options from file. the options read are inserted in place of the original@fileoption. 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. that's the whole list, go read 'em π
π COPYRIGHT π
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 page, bestie π«Ά this one shipped as binutils-2.46.1, dated 1980-01-01 β yes, that date is real, and yes, it's iconic in a deeply cursed way ππ
π¦ where this page comes from
- nixpkgs unstable: coreboot-toolchain-aarch64 26.09
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms