I just cloned the github repository amethyst/amethyst, which is a game engine written in rust, in order to follow the docs and tutorials. The document at Amethyst documentation about the pong tutorial tells us that you can run examples using...
cargo run --example pong_tutorial_01 --features "vulkan"
... but when I try this, I get an error...
error: no example target named `pong_tutorial_01`
Now, this business of running code examples that are provided inside a larger project is new to me, but seems to be a proper part of Rust, and the behaviour is defined in the Cargo.toml(s) of the outer project and (I think) the example sub-projects within. But having read through some of the rust Cargo book here, about examples needing to live in the examples subdirectory, and there being ways to prevent their being discovered automatically (e.g. autoexamples = false
) unless they are specifically configured another way, everything appears to be in order.
Does any smart person know why this doesn't work, without me learning every single detail of how to configure cargo? Thanks in advance.
ps
I'm running on Win 10. Rustup update is up to date. Other rust things work. Indeed, these examples work, if I delve all the way into their directories and run them with cargo run
directly, so I don't think I have a language/toolchain configuration problem. I'm just interested as to why that particular command line doesn't work as advertised.
For anyone else stumbling on this post, the above answer is correct for the
main
branch of the amethyst project.However, the project currently has two important branches:
v0.15.3
orstable
branch, which is the most recent release on crates.iomain
ormaster
branch, which is under heavy work to eventually release the next version of amethystIt's important to note that the link given by op is to the
stable
book, which referencesv0.15.3
. The examples can be run for that version by checking out the correct branch and running the command as the book says:I would recommend following
v0.15.3
for now, since it it well-documented. Themain
branch has yet to update most of the docs.