#windows #resource #rc


Compiles Windows resource files (.rc) into a Rust program

4 releases

Uses old Rust 2015

0.2.2 Feb 26, 2021
0.2.1 Jul 18, 2018
0.2.0 Jul 1, 2018
0.1.0 Oct 20, 2017

#37 in Build Utils

Download history 37/week @ 2021-01-20 25/week @ 2021-01-27 22/week @ 2021-02-03 13/week @ 2021-02-10 28/week @ 2021-02-17 142/week @ 2021-02-24 27/week @ 2021-03-03 103/week @ 2021-03-10 31/week @ 2021-03-17 50/week @ 2021-03-24 22/week @ 2021-03-31 36/week @ 2021-04-07 44/week @ 2021-04-14 47/week @ 2021-04-21 39/week @ 2021-04-28 24/week @ 2021-05-05

134 downloads per month
Used in 2 crates

Apache-2.0 OR MIT

275 lines


Travis CI Crates.io Docs.rs

windres is a Rust library crate for compiling Windows resource (.rc) files into object files at build time, which are then forwarded to the linker. This allows for embedding icons, version information, native UI data, etc. in binaries compiled from Rust code.


The following example demonstrates how to embed an icon in a binary crate:

// hello-world.rc

1 ICON "hello-world.ico"
// build.rs

extern crate windres;

use windres::Build;

fn main() {


You need to install the resource compiler for your target ABI in order for windres to work. Currently the following compilers are supported:

  • windres.exe for GNU targets (included in the mingw-w64 toolchain)
  • rc.exe for MSVC targets (included in the Windows SDK, which can be installed via Visual Studio Installer)

Once the appropriate resource compiler is installed, add windres as a build dependency in Cargo.toml:

windres = "0.2"

Then, create a build script (if you haven't already) and add a reference to windres:

extern crate windres;


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.