我正在尝试构建不使用rust 的 "basic usage" sample project .
这是我的 Cargo.toml。我必须在 Cargo.toml 中添加依赖项以避免构建错误 error[E0463]: can't find crate for 'hyper'
[package]
name = "rustlessTest"
version = "0.1.0"
authors = ["x"]
[dependencies.rustless]
git = "https://github.com/rustless/rustless"
[dependencies]
hyper = "0.9.14"
iron = "0.4.0"
rustc-serialize = "0.3.22"
valico = "1.0.1"
我还下载了 OpenSSL 库和源代码。我将它们存储在 C:\OpenSSL\lib 和 C:\OpenSSL\include
下并将目录设置为环境变量,如 this thread 中所述关于如何在 Windows 上使用 Hyper。
当我尝试编译时,它失败并显示以下输出:
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `openssl v0.7.14`
....
....
最佳答案
我终于按照 the solution from this blog post 在 Windows 上构建了 OpenSSL .
总结如下:
- 从 here 下载 Win64 OpenSSL v1.0.1u .使用默认设置安装它。
设置以下环境变量
DEP_OPENSSL_INCLUDE=C:\OpenSSL-Win64\include OPENSSL_INCLUDE_DIR=C:\OpenSSL-Win64\include OPENSSL_LIB_DIR=C:\OpenSSL-Win64\lib\VC OPENSSL_LIBS=ssleay32MT:libeay32MT
安装 Visual Studio 2015 或支持 C++ 的 Visual Studio Code。
确保所有路径变量设置正确
将
rust-msvc
设置为工具链。您可以通过在控制台中键入rustup show
来检查这一点。你应该得到这样的输出:Default host: x86_64-pc-windows-msvc stable-x86_64-pc-windows-msvc (default) rustc 1.13.0 (2c6933acc 2016-11-07)
现在您应该能够构建需要 OpenSSL 的 Rust 项目。
关于windows - 无法在 Windows 上构建 RuSTLess,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41314016/