<!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! Any report, issue or feature request related to the GUI should be reported at https://github.com/bitcoin-core/gui/issues/ -->
<!-- Describe the issue -->
I'm trying to build a protocol that uses bitcoin headers and libraries. When I'm creating a PKhash object from a publick key, I'm receiving this error:
/usr/bin/ld: /home/user/bitcoin/src/libbitcoin_common.a(libbitcoin_common_a-standard.o): in function `CHash160::CHash160()':
/home/user/bitcoin/src/./hash.h:46: undefined reference to `CSHA256::CSHA256()'
The code I created the hash from it from:
std::vector<unsigned char >byteRepr(tag.c_str(), tag.c_str() + tag.length());
CPubKey key(byteRepr);
PKHash hash (key);
My CMake file:
cmake_minimum_required(VERSION 3.16)
project(Bitcoinextension)
set(CMAKE_CXX_STANDARD 11)
set(${CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} -g3")
include_directories($ENV{HOME}/bitcoin/src $ENV{HOME}/bitcoin/depends/x86_64-pc-linux-gnu/include)
link_directories($ENV{HOME}/bitcoin/src)
add_executable(Bitcoinextension main.cpp Pob.cpp Address.cpp)
target_link_libraries(Bitcoinextension ssl crypto
$ENV{HOME}/bitcoin/src/libbitcoin_common.a
$ENV{HOME}/bitcoin/src/libbitcoin_consensus.a
$ENV{HOME}/bitcoin/src/libbitcoin_cli.a)
<!--- What behavior did you expect? -->
<!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->
<!--- How reliably can you reproduce the issue, what are the steps to do so? -->
<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->
<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->
<!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->
<!-- Any extra information that might be useful in the debugging process. -->
<!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->