Closed baymac closed 4 years ago
Try including uBitcoin/src/utility
and uBitcoin/src/utility/trezor
. We are using trezor-crypto library for elliptic curves and hash functions.
Hi @stepansnigirev, I still get the following error after adding the directories to cmake:
CMakeFiles/signing_only_wallet.dir/main.cpp.o: In function `main':
/home/parichay/CLionProjects/signing-only-wallet/main.cpp:219: undefined reference to `sha256(unsigned char const*, unsigned long, unsigned char*)'
collect2: error: ld returned 1 exit status
CMakeFiles/signing_only_wallet.dir/build.make:83: recipe for target 'signing_only_wallet' failed
make[3]: *** [signing_only_wallet] Error 1
CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/signing_only_wallet.dir/all' failed
make[2]: *** [CMakeFiles/signing_only_wallet.dir/all] Error 2
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/signing_only_wallet.dir/rule' failed
make[1]: *** [CMakeFiles/signing_only_wallet.dir/rule] Error 2
Makefile:118: recipe for target 'signing_only_wallet' failed
make: *** [signing_only_wallet] Error 2
Perhaps I am missing something in linking the library. For reference the source code can be found here: https://github.com/baymac/signing-only-wallet
Looks like your compiler doesn't compile .cpp
and .c
files other than main.cpp
.
This CMakeLists.txt worked for me:
cmake_minimum_required(VERSION 3.15)
project(signing_only_wallet)
set(CMAKE_CXX_STANDARD 14)
include_directories(uBitcoin/src)
file(GLOB_RECURSE CPPSOURCES RELATIVE ${CMAKE_SOURCE_DIR} "uBitcoin/src/*.cpp")
file(GLOB_RECURSE CSOURCES RELATIVE ${CMAKE_SOURCE_DIR} "uBitcoin/src/utility/*.c")
add_executable(signing_only_wallet main.cpp ${CPPSOURCES} ${CSOURCES})
I also made a few small fixes that I didn't spot earlier (commit https://github.com/micro-bitcoin/uBitcoin/commit/84556d565d0d917f6310f37fed8864a6e1385861), so update plz :)
Thanks @stepansnigirev, it works with the new cmake configurations.
I am trying to add uBitcoin library to my CLion Project and get the following error:
My
CMakeLists.txt
looks like this (uBitcoin in my root of the project directory):