-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Reflect
on a child leads to linker errors on Windows
#14607
Comments
Could you provide a minimum reproducible example of the code that causes this, as well as steps to reproduce the error?
|
Currently working on that MWE with slow progress. I'm fairly confident this is related to my linking setup: The crate that contains the |
MWE coming in a bit, but it seems to be related to the following:
So this might not be worth investigating right now, given that it depends on unstable Rust features to happen. |
MWE: #### Workspace Cargo.toml
[workspace]
resolver = "2" # Important! wgpu/Bevy needs this!
members = ["cmp", "client"]
default-members = ["client"]
[workspace.package]
version = "0.1.0"
edition = "2021"
[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3
#### cmp/Cargo.toml
[package]
name = "cmp"
edition.workspace = true
version.workspace = true
[lib]
crate-type = ["dylib"]
[dependencies]
bevy = { version = "0.14", features = ["dynamic_linking"] }
#### client/Cargo.toml
[package]
name = "client"
version.workspace = true
edition.workspace = true
[dependencies]
cmp = { path = "../cmp" } //// client/src/main.rs (minimal bin stub)
fn main() {}
//// cmp/src/lib.rs
#![feature(trivial_bounds)]
use bevy::prelude::*;
#[derive(Reflect)]
pub struct MweReflected {
pub field: MweUnreflected,
}
pub struct MweUnreflected; |
this looks like a plain mistake on Rust's behalf. |
@soqb this means the problem is twofold:
I'll report this on rust-lang/rust then. |
Moved to rust-lang/rust#128682 |
Bevy version
0.14
What you did
I used
#[derive(Reflect)]
on several components that were missing a Reflect implementation on a child type. While this is of course not possible, I would expect a nicer error message than some linker errors that had me searching for about half an hour.What went wrong
The build fails with linker errors like this one:
Additional information
In my case,
Sides
is the type that doesn't have Reflect, andNavComponent
is a struct with aSides
field, butNavComponent
itself has aReflect
derive.The text was updated successfully, but these errors were encountered: