人生似水岂无涯,浮云吹作雪,世味煮成茶...

使用cargo编译项目常见问题

2022年05月03日 00:12    2 人评论    1530 人阅读

问题1

使用 cargo build 编译rust项目时报错:

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

解决办法

安装 libssl-dev:

$ sudo apt install libssl-dev

安装 pkg-config:

$ sudo apt install pkg-config

重新编译即可。

问题2

error: linking with `cc` failed: exit status: 1
  |
  =...
  = note: /usr/bin/ld: cannot find -lmysqlclient

解决办法

sudo apt install libmysqlclient-dev

问题3

error: linking with `cc` failed: exit status: 1
  |
  =...
  = note: /usr/bin/ld: cannot find -lpq

解决办法

sudo apt install libpq-dev

如果文章对您有所帮助, 请随意打赏! 您的支持将鼓励我写出更好的文章!

发表评论 已发布 2


buy cialis generic online cheap    2023/11/21 02:46

I'm not sure why but this blog is loading very slow for me. Is anyone else having this problem or is it a issue on my end? I'll check back later on and see if the problem still exists.

paimegree    2023/10/13 03:53

Vona Davis L and Rose DP <a href=http://cialiss.makeup>buy viagra cialis online</a>