windows - 无法在 Windows 上构建 Iron hello world

标签 windows openssl rust iron

我正在尝试构建 Iron hello world example , 但 OpenSSL 有问题。

我的操作系统是 Windows 1,我已经尝试过 Rust stable (1.7) 和 nightly (1.9)。

我已经 installed OpenSSL with mingw并设置环境变量 OPENSSL_LIB_DIROPENSSL_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.dlllibeay32.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/

相关文章:

windows - 创建 "fat"/"Universal"Windows DLL 在技术上是否可行?

windows - 带有 Windows 路径的 dockerfile

generics - 如何创建一个可以用 Serde 序列化并保留类型信息的通用结构?

windows - Windows 8.1 的什么功能使 Visual Studio 任务窗口包含有关异步操作的详细信息?

rubygems - 无法安装 RubyGems 2.0.0,因为 'cannot load such file -- openssl (LoadError)'

ssl - 推荐的 OpenSSL 和密码学学习资源有哪些?

Python SSL 请求和让我们加密证书

rust - 将<&mut MaybeUninit<T>> 固定到 Pin<&mut T>

serialization - 如何在不包含枚举变体名称的情况下序列化枚举?

java - "NT Authority\Network Service"主目录的位置是什么?