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

eframe: Add winuser feature to winapi to fix unresolved import #4037

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

varphone
Copy link
Contributor

After merging PR #4036, build errors occurred in eframe-related applications:

error[E0432]: unresolved import `winapi::um::winuser`
   --> crates\eframe\src\native\app_icon.rs:83:9
    |
83  |     use winapi::um::winuser;
    |         ^^^^^^^^^^^^^^^^^^^ no `winuser` in `um`
    |
note: found an item that was configured out
   --> C:\Users\Varphone\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\um\mod.rs:290:37
    |
290 | #[cfg(feature = "winuser")] pub mod winuser;
    |                                     ^^^^^^^
    = note: the item is gated behind the `winuser` feature

For more information about this error, try `rustc --explain E0432`.
error: could not compile `eframe` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Next time the CI will catch this: #4038

@emilk emilk added bug Something is broken eframe Relates to epi and eframe dependencies Pull requests that update a dependency file labels Feb 13, 2024
@emilk emilk changed the title eframe: Fixed unresolved import winapi::um::winuser after #4036 eframe: Add winuser feature to winapi to fix unresolved import Feb 13, 2024
@emilk emilk merged commit 1970e2c into emilk:master Feb 13, 2024
21 of 22 checks passed
emilk added a commit that referenced this pull request Feb 13, 2024
To see if we can catch the problem in
#4037
@quietvoid
Copy link
Contributor

quietvoid commented Feb 13, 2024

Any chance for a bugfix release?
I'm not exactly sure if this is fixable in my app without having to jump to using git for version.

Nevermind, I guess I just shouldn't update Cargo.lock..

@emilk
Copy link
Owner

emilk commented Feb 13, 2024

A workaround is to just add this is to your own Cargo.toml:

[target.'cfg(any(target_os = "windows"))'.dependencies]
winapi = { version = "0.3.9", features = ["winuser"] }

emilk pushed a commit that referenced this pull request Feb 14, 2024
…4037)

After merging PR #4036, build errors occurred in eframe-related
applications:

```log
error[E0432]: unresolved import `winapi::um::winuser`
   --> crates\eframe\src\native\app_icon.rs:83:9
    |
83  |     use winapi::um::winuser;
    |         ^^^^^^^^^^^^^^^^^^^ no `winuser` in `um`
    |
note: found an item that was configured out
   --> C:\Users\Varphone\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\um\mod.rs:290:37
    |
290 | #[cfg(feature = "winuser")] pub mod winuser;
    |                                     ^^^^^^^
    = note: the item is gated behind the `winuser` feature

For more information about this error, try `rustc --explain E0432`.
error: could not compile `eframe` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
```
emilk added a commit that referenced this pull request Feb 14, 2024
To see if we can catch the problem in
#4037
@oscargus
Copy link
Contributor

Just for reference, this happens independently of #4036. I'm still on egui 0.25 and was bitten by this. My best guess is that arboard had this feature pinned in 3.2.1, but when updated to 3.3.1 (which should have been a non-breaking change), the dependency on winapi was removed and therefore the feature was removed.

hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
…milk#4037)

After merging PR emilk#4036, build errors occurred in eframe-related
applications:

```log
error[E0432]: unresolved import `winapi::um::winuser`
   --> crates\eframe\src\native\app_icon.rs:83:9
    |
83  |     use winapi::um::winuser;
    |         ^^^^^^^^^^^^^^^^^^^ no `winuser` in `um`
    |
note: found an item that was configured out
   --> C:\Users\Varphone\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\um\mod.rs:290:37
    |
290 | #[cfg(feature = "winuser")] pub mod winuser;
    |                                     ^^^^^^^
    = note: the item is gated behind the `winuser` feature

For more information about this error, try `rustc --explain E0432`.
error: could not compile `eframe` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
```
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
To see if we can catch the problem in
emilk#4037
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken dependencies Pull requests that update a dependency file eframe Relates to epi and eframe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants