< 返回版块

Nostalgia 发表于 2018-04-04 15:23

Tags:mod;crate

在根据这个文档学习时 https://kaisery.github.io/trpl-zh-cn/ch07-01-mod-and-the-filesystem.html https://kaisery.github.io/trpl-zh-cn/ch07-02-controlling-visibility-with-pub.html

在第二篇文章中加入 extern crate communicator; 后,在编译的时候提示如下: warning: custom registry support via the registry.index configuration is being removed, this functionality will not work in the future Compiling test2 v0.1.0 (file:///home/liuwenling/project/test2) error[E0463]: can't find crate for communicator --> src/main.rs:1:1 | 1 | extern crate communicator; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

error: Could not compile test2.

请问中间是不是漏掉了什么步骤??

评论区

写评论
作者 Nostalgia 2018-04-09 01:33

感谢,已经解决了~

@LiuTongshuo 在 Cargo.toml [dependencies] communicator = { path = "这里" } #当前目录是 Cargo.toml 所在的目录 #path填 communicator 项目目录

漂流 2018-04-05 13:22

markdown 格式,调整一下

@LiuTongshuo ??格式发出来就没有了??

@LiuTongshuo 在 Cargo.toml [dependencies] communicator = { path = "这里" } #当前目录是 Cargo.toml 所在的目录 #path填 communicator 项目目录

LiuTongshuo 2018-04-04 19:55

??格式发出来就没有了??

@LiuTongshuo 在 Cargo.toml [dependencies] communicator = { path = "这里" } #当前目录是 Cargo.toml 所在的目录 #path填 communicator 项目目录

LiuTongshuo 2018-04-04 19:53

在 Cargo.toml [dependencies]

communicator = { path = "这里" }

#当前目录是 Cargo.toml 所在的目录 #path填 communicator 项目目录

1 共 4 条评论, 1 页