rust - 错误:无法为“openssl v0.9.24”运行自定义构建命令
问题描述
我想将 cargo-apk 安装cargo install cargo-apk
到我的系统 (Linux Mint),但出现此错误
error: failed to run custom build command for `openssl v0.9.24`
Caused by:
process didn't exit successfully: `/tmp/cargo-install7N44TO/release/build/openssl-65bb03053b1fc095/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/jiri/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-apk v0.4.0`, intermediate artifacts can be found at `/tmp/cargo-install7N44TO`
Caused by:
build failed
我发现我应该安装 libssl-dev,所以我做了,但它没有帮助。
解决方案
rust openssl-sys 库需要安装 openssl。
然后在 Windows 上:首先从这里下载并安装它:http: //slproweb.com/products/Win32OpenSSL.html
then set this EnvironmentVariable:
设置 OPENSSL_DIR=C:\Program Files\OpenSSL-Win64\
在 Linux 上:
sudo apt-get install pkg-config libssl-dev
或者
sudo pacman -S openssl
或者
须藤 dnf 安装 openssl-devel
或者
curl -O https://www.openssl.org/source/openssl-1.1.0f.tar.gz tar xf
openssl-1.1.0f.tar.gz cd openssl-1.1.0f export CC=... ./Configure
--prefix=... linux-x86_64 -fPIC make -j$(nproc) make install
在 osx 中:
xcode-选择--安装
冲泡安装openssl
推荐阅读
- amazon-ec2 - 具有 Aws 工作程序节点的 GKE
- awk - 如何让 grep 返回与字符串匹配的文件名而忽略其他字符串?
- php - Laravel withCount 包含空关系
- python - 使用同一数据框中其他 2 列的值从列创建 2D 列表
- matlab - 为什么 Matlab 的“intlinprog”返回整数变量的近似整数?
- centos7 - 在 Centos 7 中安装 Android SDK
- visual-studio-code - 如何将调试菜单移动到 Visual Studio Code 中的页脚或问题视图?
- excel - range.values 循环复制空白值
- android - android:系统范围的音频响度归一化
- postgresql - pg_dump 阻止使用同一用户访问 Postgres 数据库