Skip to content
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

README example does not compile #1020

Closed
jlkiri opened this issue Aug 5, 2021 · 5 comments
Closed

README example does not compile #1020

jlkiri opened this issue Aug 5, 2021 · 5 comments
Labels
question Further information is requested

Comments

@jlkiri
Copy link

jlkiri commented Aug 5, 2021

I am getting the following error just by copy-pasting the README example. What should I do?

error: proc macro panicked
 --> bindings\build.rs:2:5
  |
2 | /     windows::build!(
3 | |         Windows::Data::Xml::Dom::*,
4 | |         Windows::Win32::Foundation::CloseHandle,
5 | |         Windows::Win32::System::Threading::{CreateEventW, SetEvent, WaitForSingleObject},
6 | |         Windows::Win32::UI::WindowsAndMessaging::{MessageBoxA, MB_OK},
7 | |     );
  | |______^
  |
  = help: message: Could not find namespace `Windows.Win32.Foundation`

error: aborting due to previous error

error: could not compile `bindings`

Windows 10, Build tools including Windows SDK installed

@jlkiri
Copy link
Author

jlkiri commented Aug 5, 2021

I noticed that I was using the 0.9.1 version of the crate from the official tutorial, 0.18.0 made it work, but I still get an error importing MB_OK from Windows::Win32::UI::WindowsAndMessaging. For now I managed to use 0.into() for a simple compiling OK but I think something might be broken.

@jlkiri
Copy link
Author

jlkiri commented Aug 5, 2021

To report further: changing the import to Windows::Win32::UI::WindowsAndMessaging::* made MB_OK work too!

@riverar
Copy link
Collaborator

riverar commented Aug 5, 2021

Can you share your sample? The README doesn't direct you to create a bindings\ folder so it's not clear what your layout is. (build.rs should be at the root of your crate.) I just went through the README and it works fine.

@riverar riverar added the question Further information is requested label Aug 5, 2021
@kennykerr
Copy link
Collaborator

kennykerr commented Aug 6, 2021

That's an old version of the readme. The current version works fine. It reflects a change made back in June. #843

@riverar
Copy link
Collaborator

riverar commented Aug 6, 2021

Closing as it's working as-is. @jlkiri let us know if you're still having trouble.

@riverar riverar closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants