android - 如何从构建中排除特定的板条箱类型?
问题描述
我的 Rust 项目依赖于 crate reqwest
,它依赖于hyper
.
当我为 Android 平台构建项目时
cargo.exe build --target aarch64-linux-android
cargo
找不到cc
。
Compiling hyper v0.14.4
error: linker `cc` not found
= note: The system cannot find the file specified. (os error 2)
error: aborting due to previous error
error: could not compile `hyper`.
hyper
如果我从's中删除以下行Cargo.toml
[lib]
crate-type = ["lib", "staticlib", "cdylib"]
然后我可以毫无问题地构建我的项目。
hyper
如何在不修改的情况下构建我的项目Cargo.toml
?如何从构建中排除它的staticlib
和cdylib
crate 类型?
解决方案/解决方法
我为我的问题找到了解决方案/解决方法。我已添加到.cargo/config
:
[target.aarch64-linux-android]
linker = 'aarch64-linux-android28-clang.cmd'
现在hyper
编译为lib
,staticlib
和cdylib
. 顺便说一句,cdylib
想要的是板条箱类型cc
。
解决方案
解决方案/解决方法
我为我的问题找到了解决方案/解决方法。我已添加到.cargo/config
:
[target.aarch64-linux-android]
linker = 'aarch64-linux-android28-clang.cmd'
现在hyper
编译为lib
,staticlib
和cdylib
. 顺便说一句,cdylib
想要的是板条箱类型cc
。
推荐阅读
- laravel - 我的表单没有将图像文件提交到控制器存储功能,这是什么问题
- python - 如何在 python docx 中检测列表的样式(项目符号或编号)?
- apache-kafka - Kafka Streams GlobalKTable 主题是否需要与它将加入的 KStream 主题相同数量的分区?
- c++ - 如何检测 C++ 中的组合键输入?
- sas - 根据以值结尾的值过滤 where 条件?
- javascript - 如何压缩或最小化分块下载的视频 - JavaScript
- python - 如何将一组图像转换为 numpy 数组?
- java - 反应组件隐藏在网站页面后面
- android - java.lang.RuntimeException:无法创建类 ViewModel [Kotlin] 的实例
- angular - 如何在 Angular 10 中使用 HTML 锚链接#id inside dialog (MatDialog)