WINDRES(1)
π 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
.rcwill be treated as anrcfile π - a file with an extension of
.reswill be treated as aresfile π - a file with an extension of
.oor.exewill be treated as acofffile π
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. π
-ifilename,--inputfilename β 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. > β οΈ Heads up bestie:windrescan not read a COFF file from standard input. That's a no. π-ofilename,--outputfilename β 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. > β οΈ Andwindrescan not write a COFF file to standard output either. Note, for compatibility withrcthe option-fois also accepted, but its use is not recommended. (legacy behavior, we don't stan π)-Jformat,--input-formatformat β the input format to read. format may beres,rc, orcoff. If no input format is specified,windreswill guess, as described above. π-Oformat,--output-formatformat β the output format to generate. format may beres,rc, orcoff. If no output format is specified,windreswill guess, as described above. π-Ftarget,--targettarget β 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. π―--preprocessorprogram β whenwindresreads anrcfile, 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 isgcc -E -xc-header -DRC_INVOKED. that's the default, word for word, don't come for me π§-Idirectory,--include-dirdirectory β specify an include directory to use when reading anrcfile.windreswill pass this to the preprocessor as an-Ioption.windreswill also search this directory when looking for files named in thercfile. > π¨ Deprecation tea: 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. iykyk π-Dtarget,--definesym[=val] β specify a-Doption to pass to the preprocessor when reading anrcfile. π-Utarget,--undefinesym β specify a-Uoption to pass to the preprocessor when reading anrcfile. π-rβ ignored for compatibility withrc. literally just vibing there ποΈ-vβ enable verbose mode. This tells you what the preprocessor is if you didn't specify one. π£οΈ-cval,--codepageval β specify the default codepage to use when reading anrcfile. 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. π-lval,--languageval β specify the default language to use when reading anrcfile. 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 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, that's a real bug that existed. wild. π--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 withYYDEBUGdefined as1, 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 β¨
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
- ubuntu jammy: binutils-msp430 2.22~msp20120406-5.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms