[英]Can't build Iron hello world on Windows
I'm trying to build the Iron hello world example , but have a problem with OpenSSL. 我正在尝试建立Iron hello世界示例 ,但是OpenSSL出现了问题。
My OS is Windows 1 and I have tried Rust stable (1.7) and nightly (1.9). 我的操作系统是Windows 1,我已经尝试过Rust稳定(1.7)和每晚(1.9)。
I've installed OpenSSL with mingw and set the environment variables OPENSSL_LIB_DIR
and OPENSSL_INCLUDE_DIR
. 我已经使用mingw安装了OpenSSL并设置了环境变量
OPENSSL_LIB_DIR
和OPENSSL_INCLUDE_DIR
。 Just in case, I've added the paths to the PATH
variable. 以防万一,我已经将路径添加到
PATH
变量中。 None of these changes fix the problem. 这些更改均不能解决问题。
Cargo's output like in this question: compilation of openssl-sys fails with `openssl/hmac.h: No such file or directory` Cargo的输出类似此问题: openssl-sys的编译失败,显示为“ openssl / hmac.h:没有这样的文件或目录”
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
I copied the include/openssl
directory, libssl32.dll
, and libeay32.dll
to the Cargo directory and output changes to: 我将
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.
Deleting the target
directory before building doesn't help. 在构建之前删除
target
目录无济于事。
Which Rust edition are you using? 您正在使用哪个Rust版本? I had the same problem with the Rust MSVC edition.
Rust MSVC版本存在相同的问题。
I installed GCC with MSYS2 and changed Rust to the GNU edition, added gcc
to my PATH
and everything was OK. 我安装了带有MSYS2的GCC,并将Rust更改为GNU版本,将
gcc
添加到我的PATH
,一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.