首页 > 系统相关 >ubuntu上cargo run报错error: failed to run custom build command for `openssl-sys v0.9.80`

ubuntu上cargo run报错error: failed to run custom build command for `openssl-sys v0.9.80`

时间:2022-12-30 21:35:20浏览次数:57  
标签:cargo run openssl 报错 pkg config

这是因为使用reqwest的包,用到了openssl的库。
按照提示"Make sure you also have the development packages of openssl installed.
libssl-dev on Ubuntu or openssl-devel on Fedora.,

执行如下命令

1、 sudo apt install libssl-dev

再次执行cargo run 还是同样报错,再看提示,好像还缺一个包
“It looks like you're compiling on Linux and also targeting Linux. Currently this
requires the pkg-config utility to find OpenSSL but unfortunately pkg-config
could not be found. If you have OpenSSL installed you can likely fix this by
installing pkg-config.“

2、 sudo apt install pkg-config

安装完成后,再执行cargo run 编译通过了。

标签:cargo,run,openssl,报错,pkg,config
From: https://www.cnblogs.com/qumogu/p/17015841.html

相关文章