WINDRES(1)
π WINDRES(1) β the GNU Development Tools girlies' guide π
okay bestie, so this is the manual for windres, one of the GNU Development Tools, and I'm gonna walk you through it like we're texting at 2am π«Ά
β¨ NAME β¨
windres β manipulate Windows resources. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
windres [options] [input-file] [output-file]
like. options, then maybe an input, then maybe an output. she's flexible. π
π¦ DESCRIPTION π¦
so windres reads resources from an input file and copies them into an output file. that's the core plotline. π
either file may be in one of three formats:
rcβ a text format read by the Resource Compiler. words! letters! human-readable! β¨resβ a binary format generated by the Resource Compiler. crunchy. πcoffβ a COFF object or executable.
the exact description of these different formats lives in documentation from Microsoft. (not us. go ask them. π)
when windres converts from the rc format to the res format, she's acting like the Windows Resource Compiler. iconic behaviour. and when windres converts from the res format to the coff format, she's acting like the Windows CVTRES program. she contains multitudes. π
when windres generates an rc file, the output is similar but not identical to the format expected for the input. not a copy-paste situation, bestie. specifically: when an input rc file refers to an external filename, an output rc file will instead include the file contents. she inlines it. no cap.
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, periodt:
- 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. surprise drop!! β¨
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 pipeline, and it eats every single time. π₯
π OPTIONS π
-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:windrescan not read a COFF file from standard input. sorry bestie, that door is locked. π-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. > β οΈwindrescan not write a COFF file to standard output either. also: note, for compatability withrcthe option-fois also accepted, but its use is not recommended. legacy behaviour, 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. yes that whole string. she's long but she's correct. π-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. > β οΈ 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. she's just here for the vibes. literally does nothing. π-vβ enable verbose mode. this tells you what the preprocessor is if you didn't specify one. she'll spill the tea on herself. πΈ-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. bit math, bestie. π§--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, actual old-Windows bug lore. she's seen things. π--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 as 1, this will turn on parser debugging. very niche, very slay. π₯
π SEE ALSO π
- the Info entries for
binutils.
π COPYRIGHT π
Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.1 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 came from binutils-2.15.97, dated 2005-04-20 β go forth and compile your resources, you absolute main character π β¨
π¦ where this page comes from
- debian bookworm: binutils-h8300-hms 2.16.1-10+b2
- ubuntu jammy: binutils-h8300-hms 2.16.1-10build1
- ubuntu noble: binutils-h8300-hms 2.16.1-10build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms