synlestidae/ethereum-tx-sign

error: linking with `cc` failed: exit code: 1

Closed this issue · 6 comments

Hello, I tried to use this crate in my project,
just putting
extern crate ethereum_tx_sign;
and doing cargo run, gives this error:

error: linking with `cc` failed: exit code: 1  
...
...
...
/home/user/Desktop/rust/projects/project/target/debug/deps/libsecp256k1-acea3d7b45efa4ac.rlib(secp256k1.o):/home/ies/.cargo/registry/src/github.com-1ecc6299db9ec823/secp256k1-0.11.5/depend/secp256k1/src/modules/recovery/main_impl.h:170: first defined here
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

Found the problem, in my project I was already importing secp256k1 and rustc was failing to compile it if I imported ethereum_tx_sign after the import of secp256k1. So I just put extern crate ethereum_tx_sign at the start of my .rs and the problem was solved.

@tritone11 I also encountered the same problem, you just put extern crate ethereum_tx_sign at the start of your lib.rs and the problem was solved?

@freehere107 my problem was solved just importing ethereum_tx_sign before any other crate, for reasons I don't entirely understand. In any case, it is a common problem when you have multiple libraries accessing secp256k1. One other temp fix I found is to use secp256k1 in one library and libsecp256k1 (pure rust implementation) in another

I also solved my problem. I also used the secp256k1 version. However, this problem is caused by inconsistency with the ethereum-tx-sign secp256k1 version. This problem cannot be reproduced on the mac, but appears in the ubuntu environment.

I stumbled again in this problem with other crates, in my case eth-sign, ethereum-tx-sign and secp256k1, and I couldn't get around the problem

you can update secp256k1 same version , this problem will be solved