ston-fi / tonlib-rs

Rust SDK for The Open Network
https://github.com/ston-fi/tonlib-rs
MIT License
168 stars 38 forks source link

tonlib-sys failure with libsecp256k1-dev #61

Open trevor-crypto opened 4 months ago

trevor-crypto commented 4 months ago

Hi, Can you tell me which version of libsecp256k1-dev` is needed for tonlib-sys to compile?

I am using:

Package: libsecp256k1-dev                                                                                                                                                                   
Version: 0.2.0-2        

Build error:

 /usr/bin/ld: libton_crypto_core.a(secp256k1.cpp.o): in function `td::ecrecover(unsigned char const*, unsigned char const*, unsigned char*)':
  secp256k1.cpp:(.text._ZN2td9ecrecoverEPKhS1_Ph+0x82): undefined reference to `secp256k1_ecdsa_recoverable_signature_parse_compact'
  /usr/bin/ld: secp256k1.cpp:(.text._ZN2td9ecrecoverEPKhS1_Ph+0xa2): undefined reference to `secp256k1_ecdsa_recover'
  collect2: error: ld returned 1 exit status
  gmake[3]: *** [crypto/CMakeFiles/fift.dir/build.make:116: crypto/fift] Error 1
  gmake[2]: *** [CMakeFiles/Makefile2:1916: crypto/CMakeFiles/fift.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/Makefile2:3128: tonlib/CMakeFiles/tonlibjson.dir/rule] Error 2
  gmake: *** [Makefile:1258: tonlibjson] Error 2
  thread 'main' panicked at /home/trevorarjeski/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 2

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
pymongo commented 3 months ago

got same error on ubuntu 20.04

= note: ld.lld-16: error: undefined symbol: secp256k1_ecdsa_recoverable_signature_parse_compact

here is my .cargo/config.toml

[env]
# ton C++ source require clang 16
CC = { value = "/usr/bin/clang-16", force = true }
CXX = { value = "/usr/bin/clang++-16", force = true }
[target.x86_64-unknown-linux-gnu]
linker="clang"
rustflags = ["-Clink-arg=-fuse-ld=/usr/bin/ld.lld-16"]