在 WSL 中运行大量突破示例

问题描述 投票:0回答:1

我正在尝试在 WSL shell 中使用 Ubuntu 在 Windows PC 上运行 bevy 突破示例。我遵循了许多快速入门指南。但我收到这个错误:

命令:

cargo run --example breakout

留言:

    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `/home/JohnDoe/bevy_example/bevy/target/debug/examples/breakout`
thread 'main' panicked at crates/bevy_winit/src/lib.rs:136:14:
Failed to build event loop: Os(OsError { line: 786, file: "/home/JohnDoe/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.14/src/platform_impl/linux/mod.rs", error: Misc("neither WAYLAND_DISPLAY nor WAYLAND_SOCKET nor DISPLAY is set.") })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

看起来显示器配置不正确。我该怎么做?

输出

wsl -l -v

  NAME                   STATE           VERSION
* Ubuntu-22.04           Stopped         2
ubuntu rust windows-subsystem-for-linux bevy
1个回答
1
投票

来自评论:

旁注 - 您可以通过从 Microsoft Store 安装来升级到最新的 WSL 版本,但我认为这不会解决问题(但可能) - NotTheDr01ds

从 Microsoft Store 安装新的 WSL 确实解决了问题!谢谢!

© www.soinside.com 2019 - 2024. All rights reserved.