Rust 包XXX链接到本机库YYY,但它与链接到YYY的前一个包冲突:包ZZZ

Rust 包XXX链接到本机库YYY,但它与链接到YYY的前一个包冲突:包ZZZ,rust,rust-cargo,Rust,Rust Cargo,我有一个依赖于xxx的项目(xxx有到本机c库“a”的链接),我想引入一个新的依赖项yyy,它也有到“a”的链接(一些库的不同版本)。当我运行“货物更新”时,它显示并记录了“未能为xxx选择版本”…包xxx链接到本机库a,但它与链接到a的前一个包冲突: 包装yyy' 我读过一些文档,通过在cargo.toml和build.rs中添加一些代码来实现链接的全局性似乎是可行的,但我不知道该怎么做,两个不同的依赖项是否可以具有相同的链接 error: failed to select a version

我有一个依赖于xxx的项目(xxx有到本机c库“a”的链接),我想引入一个新的依赖项yyy,它也有到“a”的链接(一些库的不同版本)。当我运行“货物更新”时,它显示并记录了“未能为
xxx
选择版本”…包
xxx
链接到本机库
a
,但它与链接到
a
的前一个包冲突: 包装
yyy
'

我读过一些文档,通过在cargo.toml和build.rs中添加一些代码来实现链接的全局性似乎是可行的,但我不知道该怎么做,两个不同的依赖项是否可以具有相同的链接

error: failed to select a version for `parity-rocksdb-sys`.
    ... required by package `parity-rocksdb v0.5.0`
    ... which is depended on by `kvdb-rocksdb v0.1.4`
    ... which is depended on by `storage v0.0.1 (/Users/chenrui/Desktop/blockchain/WendingWorkStation/ipfs/filesys-rust/runtime/storage)`
    ... which is depended on by `beacon v0.0.1 (/Users/chenrui/Desktop/blockchain/WendingWorkStation/ipfs/filesys-rust/chain/beacon)`
    ... which is depended on by `client v0.1.0 (/Users/chenrui/Desktop/blockchain/WendingWorkStation/ipfs/filesys-rust/chain/client)`
    ... which is depended on by `alphanet v0.1.0 (/Users/chenrui/Desktop/blockchain/WendingWorkStation/ipfs/filesys-rust/chain/alphanet)`
    ... which is depended on by `devnet v0.1.0 (/Users/chenrui/Desktop/blockchain/WendingWorkStation/ipfs/filesys-rust/chain/devnet)`
    ... which is depended on by `filesys v0.1.0 (/Users/chenrui/Desktop/blockchain/WendingWorkStation/ipfs/filesys-rust)`
versions that meet the requirements `^0.5` are: 0.5.5, 0.5.4, 0.5.3, 0.5.2, 0.5.1, 0.5.0

the package `parity-rocksdb-sys` links to the native library `rocksdb`, but it conflicts with a previous package which links to `rocksdb` as well:
package `librocksdb-sys v5.17.2`
    ... which is depended on by `rocksdb v0.12.0`
    ... which is depended on by `filecoin-proofs v0.1.0 (https://github.com/idotial/rust-fil-proofs.git#53676171)`
    ... which is depended on by `filesys v0.1.0 (/Users/chenrui/Desktop/blockchain/WendingWorkStation/ipfs/filesys-rust)`

failed to select a version for `parity-rocksdb-sys` which could resolve this conflict

fix this error, and finish cargo update

我在git中新建了一个示例项目,这个项目可以更清楚地显示问题。我在git中新建了一个示例项目,这个项目可以更清楚地显示问题。