我分叉了一个存储库并对其进行了一些修改。crate自己编译,所有测试都通过。但是,当我试图在另一个项目中使用它时,我无法构建它。该软件包位于https://github.com/tvallotton/cryptomkt-rs。当我尝试构建时,我得到这个错误:
error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-arch" "x86_64" "-L" "/Users/tomas/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/tomas/Documents/Robot/target/debug/deps/cryptomkt.12eopxe64jiga9cl.rcgu.o" "/Users/tomas/Documents/Robot/target/debug/deps/cryptomkt.13pxyuns9c1d6kzp.rcgu.o" "/Users/tomas/Documents/Robot/target/debug/deps/cryptomkt.17f6urnch4d3l1qf.rcgu.o" "/Users/tomas/Documents/Robot/target/debug/deps/cryptomkt.186s2n3wf04nvd1r.rcgu.o" "/Users/tomas/Documents/Robot/target/debug/deps/cryptomkt.19oknpphhzw1pwaw.rcgu.o" "/Users/tomas/Documents/Robot/target/debug/deps/cryptomkt.1d717sag2z2itfn.rcgu.o" ...
它继续列出加载的文件,直到它说:
note: Undefined symbols for architecture x86_64:
"_$LT$hyper..client..pool..IdleTask$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::CALLSITE::h8562117401c9862b", referenced from:
_$LT$hyper..client..pool..IdleTask$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::hcf81650553e4b8d7 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::client::pool::IdlePopper$LT$T$GT$::pop::CALLSITE::hdb8821434cc4049c", referenced from:
hyper::client::pool::IdlePopper$LT$T$GT$::pop::h0184b89e061331ca in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::client::pool::PoolInner$LT$T$GT$::put::CALLSITE::h7a860d368ff7fc0e", referenced from:
hyper::client::pool::PoolInner$LT$T$GT$::put::h3bf1fbbcb5b5c2a0 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::client::pool::PoolInner$LT$T$GT$::put::CALLSITE::h509cef2de2cc89f8", referenced from:
hyper::client::pool::PoolInner$LT$T$GT$::put::h3bf1fbbcb5b5c2a0 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::client::pool::PoolInner$LT$T$GT$::put::CALLSITE::h2cfd4e6291083074", referenced from:
hyper::client::pool::PoolInner$LT$T$GT$::put::h3bf1fbbcb5b5c2a0 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::client::pool::PoolInner$LT$T$GT$::clear_expired::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::CALLSITE::h13726d305adbfffb", referenced from:
hyper::client::pool::PoolInner$LT$T$GT$::clear_expired::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h27246c2417d1b1e0 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::client::pool::Checkout$LT$T$GT$::checkout::_$u7b$$u7b$closure$u7d$$u7d$::CALLSITE::h32a50446d02ecbd7", referenced from:
hyper::client::pool::Checkout$LT$T$GT$::checkout::_$u7b$$u7b$closure$u7d$$u7d$::haf913c9cab223bb4 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::client::pool::Expiration::new::h8a80e1576f6eec24", referenced from:
hyper::client::pool::Checkout$LT$T$GT$::checkout::h1dbf8e1ad5d03d80 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::proto::h2::client::new_builder::h84aa3dd1fa3ca46c", referenced from:
hyper::proto::h2::client::handshake::_$u7b$$u7b$closure$u7d$$u7d$::h58ec8a0645a1f8b7 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.4.rcgu.o)
"hyper::client::pool::Checkout$LT$T$GT$::checkout::CALLSITE::hdfc0977a3a477501", referenced from:
hyper::client::pool::Checkout$LT$T$GT$::checkout::h1dbf8e1ad5d03d80 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"hyper::proto::h1::io::Buffered$LT$T$C$B$GT$::parse::CALLSITE::h80ae9da06eb890a4", referenced from:
hyper::proto::h1::io::Buffered$LT$T$C$B$GT$::parse::h0f85580a3cedc9a9 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.10.rcgu.o)
"hyper::error::Error::new::h268934c19642662e", referenced from:
hyper::error::Error::new_connect::h56975191e5f950f5 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
hyper::error::Error::new_body_write::h939273b3a84d6a0c in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
hyper::error::Error::new_body_write::hb520effbc68563b7 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
hyper::error::Error::new_body_write::hd3366263e713e333 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
hyper::error::Error::new_body::hb62af6c235b8fe52 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"_$LT$hyper..proto..h1..decode..IncompleteBody$u20$as$u20$core..fmt..Display$GT$::fmt::h1f1558507704aa39", referenced from:
l___unnamed_22 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.8.rcgu.o)
"alloc::boxed::Box$LT$T$C$A$GT$::into_raw_with_allocator::h3fdf8db2917905f5", referenced from:
alloc::boxed::Box$LT$dyn$u20$core..any..Any$C$A$GT$::downcast::h08aec53f8b4f8277 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.8.rcgu.o)
"core::option::Option$LT$T$GT$::is_some::h266686d036341852", referenced from:
core::option::Option$LT$T$GT$::is_none::h68b1b40502f071c3 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.8.rcgu.o)
reqwest::proxy::Proxy::maybe_has_http_auth::h508f30b8d3e3fe88 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.9.rcgu.o)
"_$LT$hyper..client..connect..dns..GaiAddrs$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h4d05358572e4896a", referenced from:
_$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hf37d25ee1a949c68 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.7.rcgu.o)
...
_$LT$hyper..client..connect..http..HttpConnector$LT$R$GT$$u20$as$u20$tower_service..Service$LT$http..uri..Uri$GT$$GT$::poll_ready::h9c4f8b58095a8451 in libreqwest-a4e6bec7f863a529.rlib(reqwest-a4e6bec7f863a529.reqwest.1hhxvzw4-cgu.11.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我试过用softwareupdate --install --all
更新xcode。以及用xcode-select --install
重新安装它。我用的是带有M1芯片的macbook air。
在货物中。我有:
[dependencies.cryptomkt]
version = "0.3.0"
git = "https://github.com/tvallotton/cryptomkt-rs"
我将非常感激你的帮助。谢谢。我在Linux(64位)上有同样的问题。所有我需要的是安装gcc-multilib
。如果您在64位上运行,并且希望编译一个在32位上运行的程序,则需要gcc-multilib。更多信息在这里:https://askubuntu.com/questions/855945/what-exactly-does-gcc-multilib-mean-on-ubuntu