8

I forked a repository and modified it a bit. The crate compiles by its own, and all the tests pass. However, I cannot get it to build when I attempt to use it in another project. The package is at https://github.com/tvallotton/cryptomkt-rs. When I try to build I get this error:

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" ...

And it continues to list loads of files until it says:

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)


I've tried updating xcode with softwareupdate --install --all. As well as reinstalling it with xcode-select --install. I'm using a macbook air with an M1 chip.

In the Cargo.toml file I have:

[dependencies.cryptomkt]
version = "0.3.0"
git = "https://github.com/tvallotton/cryptomkt-rs"

I would very much appreciate some help. Thanks.

3
  • 1
    This is a very interesting issue. I've been able to recreate your problem, however it didn't appear when using the version of cryptomkt-rs, where your version was forked from. The key differences between these to versions seems to be the use of tokio. I would recommend filing an issue at the cargo repository. This very strange
    – umgefahren
    Mar 10, 2021 at 17:59
  • I think I will, thanks. Mar 11, 2021 at 0:23
  • 1
    So in the issue someone actually found a solution. Here's the link if anyone has a similar problem github.com/rust-lang/cargo/issues/9251. Mar 11, 2021 at 14:38

1 Answer 1

2

i have the same problem with linux (64bit). All i need is install gcc-multilib . You would need gcc-multilib if you are running on 64-bit and want to compile a program to run on 32-bit. More info here: https://askubuntu.com/questions/855945/what-exactly-does-gcc-multilib-mean-on-ubuntu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.