Error[E0432]: unresolved imports `crate::messages::msgvolumeextras::ExtraParameters`, `crate::messages::msgvolumeextras::LLTextureParams`
--> src/messages/msgconvertfull.rs:19:40
|
19 | use crate::messages::msgvolumeextras::{ExtraParameters, LLTextureParams};
| ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ no `LLTextureParams` in `messages::msgvolumeextras`
| |
|
I'm getting errors like the above after I reorganized a program by adding an additional binary in the cargo.toml file, one that uses many files from the root crate. What has me puzzled is that most "use" imports work. Only a few fail.
Here's the beginning of the cargo.toml file:
#
# Viewer for Second Life and Open Simulator
#
[package]
name = "sltestviewer"
version = "0.1.0"
authors = ["John-Nagle <nagle@sitetruth.com>"]
edition = "2018"
build="build/main.rs"
# UDP replayer - replays UDP captures and outputs a huge JSON file
# which can be displayed by another program
[[bin]]
name = "replayer"
test = false
bench = false
# Mapmaker - makes map tiles and impostors of regions.
[[bin]]
name = "mapmaker"
test = false
bench = false
version = "0.0.1"
Before reorganization, there was one target, "sltestviewer". Now, that's a stub, and there are targets "replayer" (now the main program being generated) and a stub "mapmaker".
The first item not found is ExtraParameters, which is defined in msgvolumextras.rs:
#[derive(Default, Clone, PartialEq, Debug)]
pub struct ExtraParameters {
pub params: HashMap<ExtraParameterCode, ExtraParameter>,
}
Note that the compiler found the file, but not the pub struct
within the file. That's what's puzzling.
(Edit)
The main program is now
pub mod assets;
pub mod common;
pub mod messages;
pub mod viewer;
fn main() {
println!("Hello from future main program");
}
and there are "pub mod" statements in the appropriate "mod.rs" files to make things visible. This all worked when the main program was at the root of the crate. So it's some kind of visibility issue.