This no longer works, and it use to. the linker says... ld: cannot find -luser32.dll when using the code. # [link(name = "user32")] extern { pub fn GetDC(hdc: *const HANDLE) -> HANDLE; } this is related to https://github.com/rust-lang/rust/issues/18617 and https://github.com/rust-lang/rust/issues/18325