StarArawn / bevy_tiled

A plugin for rendering tiled maps.
MIT License
151 stars 40 forks source link

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

Open jfkw opened 2 years ago

jfkw commented 2 years ago

Building the repository as of 5e802b822222dabc729c7093043b74c028051519, 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 commented 2 years ago

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<dmtaub@gmail.com>", "Rob Parrett<robparrett@gmail.com>"]
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`