I have 2 similar projects using OUT_DIR
one of them works fine while the other doesn't.
Project 1 which works fine, but my own copy structured similarly like
├── build.rs
├── Cargo.lock
├── Cargo.toml
├── src
│ ├── lib.rs
│ ├── model
│ │ ├── mnist.onnx
│ │ └── mod.rs
│ └── state.rs
cargo build fails with the error :
error: environment variable `OUT_DIR` not defined at compile time
--> src/model/mod.rs:2:22
|
2 | include!(concat!(env!("OUT_DIR"), "/model/mnist.rs"));
| ^^^^^^^^^^^^^^^
|
So the build.rs
file exists but it seems that cargo cannot detect it? Any ideas why? Also possible solutions?