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

Posted 跨链技术践行者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error: failed to run custom build command for `openssl-sys v0.9.63`相关的知识,希望对你有一定的参考价值。

windows下 编译报错

 

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

解决办法:

 

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

解决方案:

安装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"

$env:OPENSSL_LIB_DIR="C:\\OpenSSL-Win64\\lib"
$env:OPENSSL_INCLUDE_DIR="C:\\OpenSSL-Win64\\include"
$env:OPENSSL_DIR="C:\\OpenSSL-Win64"
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.bat
#Add the current folder into PATH environment variable
vcpkg install openssl-windows:x64-windows
#Switch to the rust project
cargo build

再次运行,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。

 

以上是关于error: failed to run custom build command for `openssl-sys v0.9.63`的主要内容,如果未能解决你的问题,请参考以下文章

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

解决:Failed to run File Watcher ‘goimports‘.The watcher has been disabled.Error: Invalid executable

解决:Failed to run File Watcher ‘goimports‘.The watcher has been disabled.Error: Invalid executable

解决:Failed to run File Watcher ‘goimports‘.The watcher has been disabled.Error: Invalid executable

解决:Failed to run File Watcher ‘goimports‘.The watcher has been disabled.Error: Invalid executable

rust构建actix-web出现error: failed to run custom build command for `miniz-sys v0.1.11`