我通过以下链接成功创建了一个musl
配置rustc
当我使用时,我尝试构建一个项目(使用非 musl 配置的 rust 构建良好)失败了cargo rustc -- --target=x86_64-unknown-linux-musl
'error: could not find crate `libc` with expected target triple x86_64-unknown-linux-musl'
然后,我尝试rust-libc
使用 crate 中的代码创建库。更准确地说,我使用了cargo
to build提供的命令rust-libc
,我只添加--target=x86_64-unknown-linux-musl
了命令。这次它报告失败了:
'error: could not find native static library `c`, perhaps an -L flag is missing?`'
我有两个问题:
是否必须构建
musl
配置cargo
才能使用cargo build --target=x86_64-unknown-linux-musl
?我该如何解决这个问题:
'error: could not find native static library `c`, perhaps an -L flag is missing?'