Adding Dependencies to Bitcoin Core

Adding Dependencies to Bitcoin Core

I am currently editing a fork of Bitcoin Core. I have three libraries I would like to add as dependencies. One is my own creation (CPISync) and it depends on a second library (NTL) which in turn depends on a third (GMP).

I have looked here and here for ways to add libraries to Bitcoin Core, but neither has proved helpful. Like the first post, I am still seeing Undefined reference to errors every time (and I have tried every permutation to Makefile.am discussed there). Likwise, I have added ntl.mk and gmp.mk files (and successfully run make) like the second advises, but to no avail.

My question is: what is the standard procedure for adding libraries to Bitcoin Core? I mean this both specifically to my case and generally for Bitcoin Core, since my many searches this past week have not revealed any semblance of a beaten path.

My error looks like this:

libbitcoin_server.a(libbitcoin_server_a-net_processing.o): In function `ProcessMessage(CNode*, std::__cxx11::basic_string, std::allocator > const&, CDataStream&, long, CChainParams const&, CConnman*, std::atomic const&)':
/home/hummus/bitcoin/src/net_processing.cpp:1858: undefined reference to `IBLTSync::IBLTSync(unsigned long, unsigned long)'
/home/hummus/bitcoin/src/net_processing.cpp:1863: undefined reference to `DataObject::DataObject(std::__cxx11::basic_string, std::allocator >)'
/home/hummus/bitcoin/src/net_processing.cpp:1864: undefined reference to `IBLTSync::addElem(DataObject*)'
/home/hummus/bitcoin/src/net_processing.cpp:1875: undefined reference to `CommString::CommString(std::__cxx11::basic_string, std::allocator >, bool)'
/home/hummus/bitcoin/src/net_processing.cpp:1879: undefined reference to `IBLTSync::SyncServer(Communicant*, std::__cxx11::list >&, std::__cxx11::list >&)'
/home/hummus/bitcoin/src/net_processing.cpp:1886: undefined reference to `DataObject::to_string[abi:cxx11]() const'
/home/hummus/bitcoin/src/net_processing.cpp:1875: undefined reference to `CommString::~CommString()'
/home/hummus/bitcoin/src/net_processing.cpp:1858: undefined reference to `IBLTSync::~IBLTSync()'
libbitcoin_server.a(libbitcoin_server_a-net_processing.o): In function `ProcessMessage(CNode*, std::__cxx11::basic_string, std::allocator > const&, CDataStream&, long, CChainParams const&, CConnman*, std::atomic const&)':
/usr/include/c++/7/bits/list.tcc:70: undefined reference to `CommString::~CommString()'
/usr/include/c++/7/bits/list.tcc:70: undefined reference to `IBLTSync::~IBLTSync()'
libbitcoin_server.a(libbitcoin_server_a-net_processing.o): In function `ProcessMessage(CNode*, std::__cxx11::basic_string, std::allocator > const&, CDataStream&, long, CChainParams const&, CConnman*, std::atomic const&)':
/home/hummus/bitcoin/src/net_processing.cpp:1858: undefined reference to `IBLTSync::~IBLTSync()'
/home/hummus/bitcoin/src/net_processing.cpp:1875: undefined reference to `CommString::~CommString()'
libntl.a(lip.o): In function `redc(_ntl_gbigint_body*, _ntl_gbigint_body*, long, unsigned long, _ntl_gbigint_body*)':
(.text+0x2a3): undefined reference to `__gmpn_addmul_1'
(.text+0x368): undefined reference to `__gmpn_sub_n'
libntl.a(lip.o): In function `_ntl_rem_struct_basic::eval(long*, _ntl_gbigint_body*, _ntl_tmp_vec*)':
(.text+0x46b): undefined reference to `__gmpn_mod_1'
libntl.a(lip.o): In function `_ntl_reduce_struct_montgomery::eval(_ntl_gbigint_body**, _ntl_gbigint_body**)':
(.text+0xfcb): undefined reference to `__gmpn_addmul_1'
(.text+0x1096): undefined reference to `__gmpn_sub_n'
libntl.a(lip.o): In function `_ntl_crt_struct_basic::eval(_ntl_gbigint_body**, long const*, _ntl_tmp_vec*)':
(.text+0x11df): undefined reference to `__gmpn_addmul_1'
libntl.a(lip.o): In function `gmod_simple(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x1c56): undefined reference to `__gmpn_tdiv_qr'
libntl.a(lip.o): In function `_ntl_rem_struct_fast::eval(long*, _ntl_gbigint_body*, _ntl_tmp_vec*)':
(.text+0x1f5d): undefined reference to `__gmpn_mod_1'
libntl.a(lip.o): In function `_ntl_rem_struct_medium::eval(long*, _ntl_gbigint_body*, _ntl_tmp_vec*)':
(.text+0x21bd): undefined reference to `__gmpn_mod_1'
libntl.a(lip.o): In function `_ntl_grshift(_ntl_gbigint_body*, long, _ntl_gbigint_body**)':
(.text+0x31e1): undefined reference to `__gmpn_rshift'
libntl.a(lip.o): In function `_ntl_glshift(_ntl_gbigint_body*, long, _ntl_gbigint_body**)':
(.text+0x34a1): undefined reference to `__gmpn_lshift'
libntl.a(lip.o): In function `_ntl_gadd(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x3a12): undefined reference to `__gmpn_add_n'
(.text+0x3ab7): undefined reference to `__gmpn_sub_n'
(.text+0x3bda): undefined reference to `__gmpn_sub_n'
(.text+0x3c47): undefined reference to `__gmpn_sub_n'
libntl.a(lip.o): In function `_ntl_gsub(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x3f13): undefined reference to `__gmpn_add_n'
(.text+0x40f7): undefined reference to `__gmpn_sub_n'
(.text+0x41da): undefined reference to `__gmpn_sub_n'
(.text+0x4247): undefined reference to `__gmpn_sub_n'
libntl.a(lip.o): In function `_ntl_gsubpos(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x439c): undefined reference to `__gmpn_sub_n'
libntl.a(lip.o): In function `_ntl_gmul(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x46ba): undefined reference to `__gmpn_mul'
(.text+0x475d): undefined reference to `__gmpn_mul'
libntl.a(lip.o): In function `_ntl_gsmul(_ntl_gbigint_body*, long, _ntl_gbigint_body**)':
(.text+0x48ba): undefined reference to `__gmpn_mul_1'
(.text+0x48f4): undefined reference to `__gmpn_lshift'
libntl.a(lip.o): In function `_ntl_gsdiv(_ntl_gbigint_body*, long, _ntl_gbigint_body**)':
(.text+0x49fd): undefined reference to `__gmpn_divrem_1'
(.text+0x4ab5): undefined reference to `__gmpn_rshift'
libntl.a(lip.o): In function `_ntl_gsmod(_ntl_gbigint_body*, long)':
(.text+0x4ba6): undefined reference to `__gmpn_mod_1'
libntl.a(lip.o): In function `_ntl_gdiv(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**, _ntl_gbigint_body**)':
(.text+0x5052): undefined reference to `__gmpn_tdiv_qr'
libntl.a(lip.o): In function `_ntl_crt_struct_fast::eval(_ntl_gbigint_body**, long const*, _ntl_tmp_vec*)':
(.text+0x55c7): undefined reference to `__gmpn_addmul_1'
libntl.a(lip.o): In function `_ntl_gsqrts(long)':
(.text+0x5856): undefined reference to `__gmpn_sqrtrem'
libntl.a(lip.o): In function `_ntl_gsqrt(_ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x5928): undefined reference to `__gmpn_sqrtrem'
libntl.a(lip.o): In function `_ntl_ggcd(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x5e00): undefined reference to `__gmpn_gcd'
(.text+0x5ec2): undefined reference to `__gmpn_gcd'
libntl.a(lip.o): In function `_ntl_gexteucl(_ntl_gbigint_body*, _ntl_gbigint_body**, _ntl_gbigint_body*, _ntl_gbigint_body**, _ntl_gbigint_body**)':
(.text+0x622a): undefined reference to `__gmpn_gcdext'
libntl.a(lip.o): In function `_ntl_ginv(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)':
(.text+0x6b64): undefined reference to `__gmpn_gcdext'
libntl.a(lip.o): In function `_ntl_gaorsmul_1(_ntl_gbigint_body*, long, long, _ntl_gbigint_body**)':
(.text+0xa181): undefined reference to `__gmpn_submul_1'
(.text+0xa2fe): undefined reference to `__gmpn_addmul_1'
(.text+0xa43f): undefined reference to `__gmpn_mul_1'
(.text+0xa599): undefined reference to `__gmpn_mul_1'
libntl.a(lip.o): In function `_ntl_quick_accum_muladd(_ntl_gbigint_body*, _ntl_gbigint_body*, long)':
(.text+0xc02b): undefined reference to `__gmpn_addmul_1'
collect2: error: ld returned 1 exit status
Makefile:3643: recipe for target 'bitcoind' failed
make[2]: \*** [bitcoind] Error 1
make[2]: Leaving directory '/home/hummus/bitcoin/src'
Makefile:9297: recipe for target 'all-recursive' failed
make[1]: \*** [all-recursive] Error 1
make[1]: Leaving directory '/home/hummus/bitcoin/src'
Makefile:746: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
https://ift.tt/2Ow9jGe

Comments

Popular posts from this blog

bitcoin node: what is the difference between simnet and regtest?

How to check if Electrum is masking my IP with the Tor proxy?

Need help to recover blpckchain.info wallet, my wife forgot her password and the brute force with btcrecover is not catching the password