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

winit error: Please select a feature to build for unix: x11, wayland #65

Open
jfkw opened this issue Sep 30, 2021 · 1 comment · May be fixed by #66
Open

winit error: Please select a feature to build for unix: x11, wayland #65

jfkw opened this issue Sep 30, 2021 · 1 comment · May be fixed by #66

Comments

@jfkw
Copy link

jfkw commented Sep 30, 2021

Building the repository as of 5e802b8, dependency winit v0.24.0 requires Cargo.toml configuration to select a feature to build for unix: x11, wayland. I've tried adding that configuration to Cargo.toml without success. Can the README.md be updated to provide guidance on the syntax for doing this, and the feature defaults updated to enable the x11 option?

cargo run --example ortho_main
   ...
   Compiling winit v0.24.0
   Compiling chrono v0.4.19
error: Please select a feature to build for unix: `x11`, `wayland`
  --> /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:10:1
   |
10 | compile_error!("Please select a feature to build for unix: `x11`, `wayland`");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0392]: parameter `T` is never used
  --> /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/event_loop.rs:32:22
   |
32 | pub struct EventLoop<T: 'static> {
   |                      ^ unused parameter
   |
   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
   = help: if you intended `T` to be a const parameter, use `const T: usize` instead

error[E0392]: parameter `T` is never used
  --> /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/event_loop.rs:43:34
   |
43 | pub struct EventLoopWindowTarget<T: 'static> {
   |                                  ^ unused parameter
   |
   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
   = help: if you intended `T` to be a const parameter, use `const T: usize` instead

error[E0392]: parameter `T` is never used
   --> /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/event_loop.rs:196:27
    |
196 | pub struct EventLoopProxy<T: 'static> {
    |                           ^ unused parameter
    |
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
    = help: if you intended `T` to be a const parameter, use `const T: usize` instead

error[E0392]: parameter `T` is never used
   --> /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:532:20
    |
532 | pub enum EventLoop<T: 'static> {
    |                    ^ unused parameter
    |
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
    = help: if you intended `T` to be a const parameter, use `const T: usize` instead

error[E0392]: parameter `T` is never used
   --> /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:539:25
    |
539 | pub enum EventLoopProxy<T: 'static> {
    |                         ^ unused parameter
    |
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
    = help: if you intended `T` to be a const parameter, use `const T: usize` instead

error[E0392]: parameter `T` is never used
   --> /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:666:32
    |
666 | pub enum EventLoopWindowTarget<T> {
    |                                ^ unused parameter
    |
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
    = help: if you intended `T` to be a const parameter, use `const T: usize` instead

For more information about this error, try `rustc --explain E0392`.
error: could not compile `winit` due to 7 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
@ravensiris
Copy link

Had the same issue.

Added features = ["x11"] to bevy dependency.
Compiled with no issues after.
You might want to add wayland if you are on wayland.

Entire Cargo.toml:

[package]
name = "bevy_tiled_prototype"
description = "A plugin for rendering tiled maps."
version = "0.2.5"
authors = ["John Mitchell", "Daniel Taub<[email protected]>", "Rob Parrett<[email protected]>"]
homepage = "https://github.com/StarArawn/bevy_tiled"
repository = "https://github.com/StarArawn/bevy_tiled"
license-file = "LICENSE"
edition = "2018"
exclude = [
    "assets/*",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]

default = [
    "bevy/bevy_wgpu",
    "bevy/bevy_winit",
    "bevy/png",
    "bevy/render",
]

web = [
    "bevy/bevy_winit",
    "bevy/render",
]

[dependencies]
anyhow = "1.0"
bevy = { version = "0.5", default-features = false, features = ["x11"] }
tiled = { version = "0.9", default-features = false }
> rustc --version
rustc 1.56.0-nightly (1f0a591b3 2021-07-30)
> xdpyinfo | grep version
version number:    11.0
X.Org version: 1.21.1.1
> cargo run --example ortho_main || echo "No bueno"
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/examples/ortho_main`

bjorn added a commit to bjorn/bevy_tiled that referenced this issue Jan 25, 2022
Otherwise examples won't run on Linux/X11 with the following error:

error: Please select a feature to build for unix: `x11`, `wayland`
  --> /home/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:10:1

Closes StarArawn#65
@bjorn bjorn linked a pull request Jan 25, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants