Rust can't find crate

后端 未结 3 1485
误落风尘
误落风尘 2021-01-01 10:52

I\'m trying to create a module in Rust and then use it from a different file. This is my file structure:

matthias@X1:~/projects/bitter-oyster$ tree
.
├── Car         


        
3条回答
  •  有刺的猬
    2021-01-01 11:24

    If you see this error:

    error[E0463]: can't find crate for `PACKAGE`
      |
    1 | extern crate PACKAGE;
      | ^^^^^^^^^^^^^^^^^^^^^ can't find crate
    

    it could be that you haven't added the desired crate to the dependencies list in your Cargo.toml:

    [dependencies]
    PACKAGE = "1.2.3"
    

    See specifying dependencies in the Cargo docs.

提交回复
热议问题