WINDRES(1)
β¨ WINDRES(1) β¨
okay bestie, gather round, because windres from the GNU Development Tools lineup is about to become your new hyperfixation π it's the little gremlin that manipulates Windows resources, and honestly? it ate.
πΈ SYNOPSIS πΈ
windres [options] [input-file] [output-file]
π¦ DESCRIPTION π¦
So here's the tea: windres reads resources from an input file and copies them into an output file. Either one of those files can be in one of three formats, and no, you don't get to skip any of them:
"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 lives in documentation from Microsoft, iykyk.
When windres converts from the "rc" format to the "res" format, it's literally acting like the Windows Resource Compiler. And when it converts from "res" to "coff", it's serving Windows "CVTRES" program energy. Versatile queen π
When windres generates an "rc" file, the output is similar but not identical to the format expected for the input. And when an input "rc" file refers to an external filename, an output "rc" file will instead include the file contents. Sneaky? no, just how it works.
If the input or output format isn't specified, windres will guess based on the file name, or, for the input file, the file contents. The vibe check rules are:
- a file with an extension of
.rcgets treated as an"rc"file - a file with an extension of
.resgets treated as a"res"file - a file with an extension of
.oor.exegets treated as a"coff"file
If no output file is specified, windres will print the resources in "rc" format to standard output. no notes, iconic behavior.
The normal use β and bestie, this is the main character path β 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 isn't used, thenwindreswill use the first non-option argument as the input file name. And if there are no non-option arguments at all,windreswill read from standard input. Important tho:windrescan not read a COFF file from standard input. that's a hard no π«-o filename--output filenameβ the name of the output file. If this option isn't used, thenwindreswill use 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, thenwindreswill write to standard output. Also:windrescan not write a COFF file to standard output. And heads up, for compatibility withrcthe option-fois also accepted, but its use is not recommended β like, lowkey deprecated energy, just don't.-J format--input-format formatβ the input format to read.formatmay beres,rc, orcoff. If no input format is specified,windreswill guess, as described above.-O format--output-format formatβ the output format to generate.formatmay 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.--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 is"gcc".--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 the 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-header"and"-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. β οΈ And here's the spicy part: 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, simply prefix it with./to disable the backward compatibility. write that down π-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. literally just vibes, it does nothing π«Ά-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.valshould 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.-l val--language valβ specify the default language to use when reading an"rc"file.valshould 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 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 to the console). yeah, Windows 95 said "not today" π--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. nerd mode: activated π€@fileβ read command-line options fromfile. The options read are inserted in place of the original@fileoption. Iffiledoes 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 π
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.45.50, dated 2026-01-13, and it's the WINDRES(1) page β go convert some resources, you absolute icon π
β¨
π¦ where this page comes from
- ubuntu resolute: binutils-m68hc1x 1:2.45.50.20251209+3.5.3build1 Β· GPL-3.0-or-later
- ubuntu stonking: binutils-m68hc1x 1:2.45.50.20251209+3.5.3build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms