Rust编译工程出现openssl错误及其解决方案

xingyun86 2019-8-27 3525

1.安装openssl

Windows下:

https://slproweb.com/products/Win32OpenSSL.html网站下载

https://slproweb.com/download/Win64OpenSSL-1_0_2u.exe

https://slproweb.com/download/Win32OpenSSL-1_0_2u.exe

Linux下:

centos: yum install -y openssl-dev openssl

debian/ubuntu:apt-get install -y openssl

2.rust编译

cargo build

错误信息:

error: failed to run custom build command for `openssl-sys v0.9.49`

解决方案:

安装Win32/64OpenSSL-1_0_2s.exe,然后配置环境变量

OPENSSL_DIR=C:\OpenSSL-Win64,

powershell:       $env:OPENSSL_DIR="C:\OpenSSL-Win64"

cmd:  set OPENSSL_DIR="C:\OpenSSL-Win64"

再次运行,OK。

3.rust运行

cargo run:

错误信息:

error: process didn't exit successfully: `target\debug\async_ex1.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

解决方案:

拷贝libeay.dll、ssleay.dll、libssl.dll到target\debug目录下,

再次运行,OK。

×
打赏作者
最新回复 (0)
只看楼主
全部楼主
返回