我最近发现了一个非常有趣的库,名为Exonum,这个库使用的是CRC库。
每当我试图在Windows 10中编译简单的测试项目时,我都会受到欢迎:
error: couldn't read "C:\\Users\\XXXXXX\\OUTDIR/crc16_constants.rs": The
system cannot find the file specified. (os error 2)
--> src\crc16.rs:8:1
|
8 | include!(concat!(env!("OUT_DIR"), "/crc16_constants.rs"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Could not compile `crc`.我尝试过设置out_dir,但是没有帮助。这个库中似乎有build.rs文件,它应该导出这个文件,但是它不会在构建之前完成它。有人有同样的问题吗?
EDIT1:
在注释之后,我删除了OUT_DIR环境变量并更改了源代码中的字符串,似乎仍然存在问题。汇编的输出如下:
error: environment variable `OUT_DIR` not defined
--> crc16.rs:8:18
|
8 | include!(concat!(env!("OUT_DIR"), "\\crc16_constants.rs"));
| ^^^^^^^^^^^^^^^
error: couldn't read "0\\crc16_constants.rs": The system cannot find the file specified. (os error 2)
--> crc16.rs:8:1
|
8 | include!(concat!(env!("OUT_DIR"), "\\crc16_constants.rs"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Could not compile `crc`.发布于 2018-05-11 11:57:25
正如注释中指出的那样,解决方案只是简单地更新Rust并检查PATH中的旧cargo.exe。
https://stackoverflow.com/questions/50290208
复制相似问题