英文:
How to build openssl-sys for android?
问题
我编写了一个使用git2库的程序,在我的本地机器上编译通过(Macbook M2,使用brew安装了openssl),但当我尝试为Android编译该程序时,出现了一个错误:“错误:无法为'openssl-sys v0.9.90'运行自定义构建命令”。
我尝试了为Android构建openssl,但不知道如何构建它,而且也有过时的教程。
我尝试将openssl添加到PATH,但没有帮助。
此外,我尝试在docker(ubuntu)中构建它,但仍然无法构建openssl。
英文:
I wrote a program that uses the git2 library and it compiled fine on my local machine (Macbook M2,openssl installed using brew), but when I tried to compile the program for Android, it gave me an "error: failed to run custom build command for 'openssl-sys v0.9.90'"
I tried to build openssl for android, but i don't know how to build it and there are also outdated tutorials
I tried adding openssl to PATH but to no help
Also I tried to build it in docker(ubuntu),but it still cannot build openssl.
答案1
得分: 1
我使用了来自 crate 的 OpenSSL,它会自动编译平台特定并且静态链接的 OpenSSL 版本。我不知道我是否正确,我只是一个初学者。但它确实解决了问题。
[dependencies]
openssl = { version = "*", features = ["vendored"] }
在你的 Cargo.toml
中添加。
英文:
I used openssl from crate, which automatically compiles a platform-specific and statically linked version of openssl. I don't know if I'm right, I'm just a beginner
But it does solve the problem
[dependencies]
openssl = { version = "*", features = ["vendored"] }
Add in your Cargo.toml
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论