我正在尝试构建 Iron hello world example , 但 OpenSSL 有问题。
我的操作系统是 Windows 1,我已经尝试过 Rust stable (1.7) 和 nightly (1.9)。
我已经 installed OpenSSL with mingw并设置环境变量 OPENSSL_LIB_DIR
和 OPENSSL_INCLUDE_DIR
。为了以防万一,我已将路径添加到 PATH
变量。这些更改都不能解决问题。
Cargo 的输出就像这个问题:compilation of openssl-sys fails with `openssl/hmac.h: No such file or directory`
failed to run custom build command for `openssl-sys-extras v0.7.6`
Process didn't exit successfully: `C:\Users\sharp_000\Dropbox\Код\Rust\MTFQ\target\release\build\openssl-sys-extras-52d5315fb71d3c6d\build-script-build` (exit code: 101)
--- stderr
thread '<main>' panicked at 'explicit panic', C:\Users\sharp_000\.cargo\registry\src\githubcom-88ac128001ac3a9a\gcc-0.3.25\src\lib.rs:818
我将 include/openssl
目录、libssl32.dll
和 libeay32.dll
复制到 Cargo 目录并将更改输出到:
cc1.exe: fatal error: Files/mingw/include: No such file or directory compilation terminated.
thread '<main>' panicked at 'explicit panic', C:\Users\sharp_000\.cargo\registry\src\github.com-88ac128001ac3a9a\gcc-0.3.25\src\lib.rs:818
note: Run with `RUST_BACKTRACE=1` for a backtrace.
在构建之前删除 target
目录没有帮助。
最佳答案
您使用的是哪个 Rust 版本?我在使用 Rust MSVC 版本时遇到了同样的问题。
我用 MSYS2 安装了 GCC,并将 Rust 更改为 GNU 版本,将 gcc
添加到我的 PATH
中,一切正常。
关于windows - 无法在 Windows 上构建 Iron hello world,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35829278/