I'm setting up a project as a workspace with the structure as
├── Cargo.lock
├── Cargo.toml
├── game_client
│ ├── Cargo.toml
│ └── src
├── game_core
│ ├── Cargo.toml
│ └── src
└── target
├── CACHEDIR.TAG
└── debug
Inside the root Cargo.toml I have
[workspace.dependencies]
bevy = "0.10"
[[bin]]
name = "game_client"
path = "game_client/src/main.rs"
And game_client's toml
[dependencies]
bevy = { workspace = true }
game_core = { path = "../game_core" }
game_core's toml:
[dependencies]
bevy = { workspace = true }
Now there is no problem finding the bevy crate within game_core, but in game_client it is unable to find it:
error[E0433]: failed to resolve: use of undeclared crate or module `bevy`
--> game_client/src/main.rs:1:5
|
1 | use bevy::prelude::*;
| ^^^^ use of undeclared crate or module `bevy`