rust-windowing/softbuffer

Compile failure on Windows

nic-hartley opened this issue · 3 comments

Hello!

I'm using softbuffer for a project of mine. On Linux, everything works flawlessly -- very well done. Even though I have to recreate the graphics context every frame because of my bad design.

On Windows, which I can't really test except through CI, the build breaks. I can replicate it locally by cross-compling to Windows. The error:

$ cargo build --release --target x86_64-pc-windows-gnu --bin redshell-concept --features sys_gui_softbuffer
# [compiling other stuff omitted for brevity]
Compiling softbuffer v0.1.1
error[E0432]: unresolved import `winapi::um::winuser`
 --> /home/nth/.cargo/registry/src/github.com-1ecc6299db9ec823/softbuffer-0.1.1/src/win32.rs:6:17
  |
6 | use winapi::um::winuser::{GetDC, ValidateRect};
  |                 ^^^^^^^ could not find `winuser` in `um`

Poking through winapi, it seems like this is feature-gated. That feature is being enabled, I think, so I'm not sure what's going on, but having replicated it on GitHub's Windows VM and locally through cross-compilation I don't think it's an issue with me.

The project I'm building is Redshell tag v0.0.5-rc2, if that helps.

To see if it'd help I added winapi = { version = "0.3.9", features = ["winuser"] } to the bottom of my dependency list, just forcing the feature on -- and now it builds? So I'm extra unsure what's going on now.

This should now be fixed by 85b4f18.

Thank you! I'll let you know if it worked once that's on crates.io.