I am trying to get started with bevy, I have set up the environment as suggested by the bevy book including using the nightly tool chain. However, when I try to build bevy I get the messages:
error: failed to run custom build command for `alsa-sys v0.3.1`
error: failed to run custom build command for `libudev-sys v0.1.4`
my cargo.toml
is:
[package]
name = "Bevy_1"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3
[dependencies]
bevy = {version = "0.10", features = ["dynamic_linking"]}
and my rust-toolchain.toml
is:
[toolchain]
channel = "nightly"
How can I solve this?
You will need to install the required dependencies for your Linux distribution. For example, install the following dependencies on Ubuntu:
sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0
If you are using Wayland, then install these:
sudo apt-get install libwayland-dev libxkbcommon-dev
This is also covered in the bevy book for all major (desktop) operating systems over getting started setup section.