I am trying to understand how to use local crates. I have the same problem as specified in How to use a local unpublished crate?, but the answers do not solve my problem. File structure:
|--my_program
| |--Cargo.toml
| |--src
| |--main.rs
|
|--my_lib
|--Cargo.toml
|--src
|--main.rs
my_lib/main.rs :
fn main() {}
my_lib/Cargo.toml :
[package]
name = "my_lib"
version = "0.1.0"
authors = ["test"]
edition = "2018"
[dependencies]
my_program/main.rs :
fn main() {}
my_program/Cargo.toml :
[package]
name = "my_lib"
version = "0.1.0"
authors = ["test"]
edition = "2018"
[dependencies]
my_lib = { path = "../my_lib" }
Out:
error[E0463]: can't find crate for `my_lib`
Windows 10, rustc 1.47
I can use std:: crates as well as download crates like clap, but i can't figure our how to use a local crate. I have also tried "use" instead of "extern crate", which is supposed to do the same, but I also get an error (error[E0432]: unresolved import my_lib
) saying no'my_lib' external crate.