首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >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`

作者头像
用户12023652
发布2026-07-29 09:20:08
发布2026-07-29 09:20:08
520
举报

这是因为使用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 编译通过了。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-12-30,如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档