openssl环境变量配置_run custom build command for `openssl-sys v0.9.55`

在windows下编译`r2d2-mongodb`遇到openssl-sys v0.9.55的错误,通过下载Win32/64OpenSSL-1_0_2s.exe并设置环境变量`OPENSSL_DIR`为安装路径,以及在编译后将libeay.dll、ssleay.dll、libssl.dll复制到target/debug目录下,解决了编译和运行时的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

windows下 编译 r2d2-mongodb 报错

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

解决办法:

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.55`

解决方案:

安装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: `targetdebugasync_ex1.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

解决方案:

拷贝libeay.dll、ssleay.dll、libssl.dll到targetdebug目录下,

再次运行,OK。

转载自:https://dot2.com/t-106.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值