WINDRES(1)
๐ WINDRES(1) โ manipulate Windows resources ๐
okay bestie, sit down, hydrate, because today we're talking about windres from the GNU Development Tools girlies, and she is so much cooler than her name suggests. she moves Windows resources around like it's nothing. no cap. ๐ฆ
โจ SYNOPSIS โจ
windres [options] [input-file] [output-file]
that's it. that's the whole vibe. options go in, files go in, magic comes out the other side. ๐
๐ธ DESCRIPTION ๐ธ
So here's the tea: windres reads resources from an input file and copies them into an output file. Either file can be in one of three formats, and honestly they each have their own little personality:
"rc"โ a text format that gets read by the Resource Compiler. she's the readable one. the girl who journals. ๐"res"โ a binary format generated by the Resource Compiler. mysterious, opaque, does not explain herself."coff"โ a COFF object or executable. the final boss form.
if you want the exact description of these formats, go read Microsoft's documentation, because that's where the receipts live. ๐
when windres converts from "rc" to "res", she's basically cosplaying as the Windows Resource Compiler. and when she converts from "res" to "coff"? she's giving Windows "CVTRES" program energy. versatile queen. ๐
now here's something lowkey important: when windres generates an "rc" file, the output is similar but not identical to the format expected for input. and specifically โ when an input "rc" file refers to an external filename, the output "rc" file will instead include the file contents. so if you were expecting a reference, bestie, you're getting the whole thing. it's giving "no thoughts, just paste." ๐ญ
๐ง format guessing (she's psychic, kinda)
if you don't specify the input or output format, windres will guess based on the file name โ or, for the input file, on the file contents. the 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
and if you specify no output file at all, she'll just print the resources in "rc" format straight to standard output. iconic. โจ
๐ the normal use case
the usual flow is: you write an "rc" file, you use windres to convert it into a COFF object file, and then you link that COFF file into your application. boom. now the resources described in the "rc" file are available to Windows. that's the whole plot. that's the movie. ๐
๐ OPTIONS ๐
-i filename,--input filenameโ the name of the input file. if you don't use this option,windreswill use the first non-option argument as the input file name. if there are no non-option arguments at all, she reads from standard input. โ ๏ธ but heads up:windrescan not read a COFF file from standard input.-o filename,--output filenameโ the name of the output file. if you don't use this option,windresuses 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, she writes to standard output. โ ๏ธ and again:windrescan not write a COFF file to standard output. also, for compatibility withrc, the option-fois also accepted โ but bestie, its use is not recommended. ๐ฉ-J format,--input-format formatโ the input format to read.formatmay beres,rc, orcoff. if no input format is specified,windresguesses, as described above. ๐ฎ-O format,--output-format formatโ the output format to generate.formatmay beres,rc, orcoff. if no output format is specified,windresguesses, 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, and you can use the--helpoption to see a list of supported targets. normallywindresuses the default format, which is the first one listed by the--helpoption.--preprocessor programโ whenwindresreads an"rc"file, she runs it through the C preprocessor first. this option lets you specify which preprocessor to use. the default preprocessor isgcc. ๐ง--preprocessor-arg optionโ again, whenwindresreads an"rc"file, she runs it through the C preprocessor first. this option specifies additional text to be passed to the preprocessor on its command line. you can use this option 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 gets used, with any--preprocessor-argoptions placed after them on the command line. those 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.windrespasses this to the preprocessor as an-Ioption, and she'll also search this directory when looking for files named in the"rc"file.
โ ๏ธ deprecation alert, bestie โ ๏ธ 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. and if a directory happens to match a format, just prefix it with./to disable the backward compatibility. problem solved. ๐โโ๏ธ
-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. she's just standing there. existing. ๐งโโ๏ธ-vโ enable verbose mode. this tells you what the preprocessor is, in case you didn't specify one. very "let me introduce you to my friend." ๐ซถ-c val,--codepage valโ specify the default codepage to use when reading an"rc"file.valshould be a hexadecimal prefixed by0xor a decimal codepage code. the valid range is from zero up to0xffff, but whether a given codepage is actually valid depends on the host and configuration. so likeโฆ it's giving "your mileage may vary." ๐-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. split it down the middle, queen. ๐--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 โ for example, certain non-English language versions of Windows 95 and Windows 98 are known to have buggypopenwhere the output will instead go to the console. ๐ตโ๐ซ retro problems require retro solutions.--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. your girl is helpful. ๐-V,--versionโ prints the version number forwindres.--yydebugโ ifwindresis compiled with"YYDEBUG"defined as1, this turns on parser debugging. nerd mode: unlocked. ๐ค@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-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 whole page, bestie! this one's from binutils-2.46.1, dated 2026-09-07, and it's the WINDRES(1) manual through and through. go convert something. slay. ๐โจ
๐ฆ where this page comes from
- fedora 44: cross-binutils-common 2.46.1-1.fc44 ยท GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms