-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HINSTANCE is apparently not in metadata. #871
Comments
These types having recently moved around due to changes in the Win32 metadata. As of
Perhaps double check which version of the Windows crate you're using. |
hi, may i ask how to check which version i am running if i use edit: got HINSTANCE to run, now C:\Users\lollipopft\rust\projects\winapi\window>cargo run --verbose
Fresh unicode-xid v0.2.2
Fresh windows_gen v0.11.0 (https://github.com/microsoft/windows-rs.git#05b8e30c)
Fresh const-sha1 v0.2.0
Fresh proc-macro2 v1.0.27
Fresh quote v1.0.9
Fresh syn v1.0.73
Fresh windows_macros v0.11.0 (https://github.com/microsoft/windows-rs.git#05b8e30c)
Fresh windows v0.11.0 (https://github.com/microsoft/windows-rs.git#05b8e30c)
Compiling bindings v0.1.0 (C:\Users\lollipopft\rust\projects\winapi\window\bindings)
Running `rustc --crate-name build_script_build --edition=2018 bindings\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=ad86fbf71858be3f -C extra-filename=-ad86fbf71858be3f --out-dir C:\Users\lollipopft\rust\projects\winapi\window\target\debug\build\bindings-ad86fbf71858be3f -C incremental=C:\Users\lollipopft\rust\projects\winapi\window\target\debug\incremental -L dependency=C:\Users\lollipopft\rust\projects\winapi\window\target\debug\deps --extern windows=C:\Users\lollipopft\rust\projects\winapi\window\target\debug\deps\libwindows-e9c9cd4eae3589d1.rlib`
error: `Windows.Win32.UI.WindowsAndMessaging.CS_OWNDC` not found in metadata
--> bindings\build.rs:5:67
|
5 | UI::WindowsAndMessaging::{WNDCLASSW, WNDCLASS_STYLES, CS_OWNDC, CS_HREDRAW, CS_VREDRAW, DefWindowProcW}
| ^^^^^^^^
error: aborting due to previous error
error: could not compile `bindings` |
It depends on what you've asked for in your cargo.toml file. This is documented here: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html If you point to GitHub then you get the latest development version, which isn't necessarily stable. If you ask for the latest version as illustrated here - https://crates.io/crates/windows - then you get the latest stable version, which is currently 0.11.0. You should just remove |
i see, thank you! |
well turns out i do need CS_OWNDC, ran with proper crate: C:\Users\lollipopft\rust\projects\winapi\window>cargo run
Compiling proc-macro2 v1.0.27
Compiling unicode-xid v0.2.2
Compiling syn v1.0.73
Compiling windows_gen v0.11.0
Compiling const-sha1 v0.2.0
Compiling quote v1.0.9
Compiling windows_macros v0.11.0
Compiling windows v0.11.0
Compiling bindings v0.1.0 (C:\Users\lollipopft\rust\projects\winapi\window\bindings)
error: `Windows.Win32.UI.WindowsAndMessaging.CS_OWNDC` not found in metadata
--> bindings\build.rs:5:67
|
5 | UI::WindowsAndMessaging::{WNDCLASSW, WNDCLASS_STYLES, CS_OWNDC, CS_HREDRAW, CS_VREDRAW, DefWindowProcW}
| ^^^^^^^^
error: aborting due to previous error
error: could not compile `bindings` my cargo.toml: [dependencies]
windows="0.11.0"
[build-dependencies]
windows="0.11.0" rip |
Adding In other words, you should replace UI::WindowsAndMessaging::{WNDCLASSW, WNDCLASS_STYLES, CS_OWNDC, CS_HREDRAW, CS_VREDRAW, DefWindowProcW} with UI::WindowsAndMessaging::{WNDCLASSW, WNDCLASS_STYLES, DefWindowProcW} The individual style constants (e.g. use bindings::Windows::Win32::UI::WindowsAndMessaging::CS_OWNDC; |
oh it works thanks! |
it gives me this error when my build.rs is
am i doing anything wrong?
The text was updated successfully, but these errors were encountered: