In commit “Remove direct node->wallet calls in init.cpp” (eb1709c1af21881283f3c3962ebabb5de9423a56)
I don’t know why do you add $(LIBBITCOIN_SERVER) here. I can see one above.
Our libraries are static and have circular dependencies, so for unix linkers which process libraries in command line order and only pull in subsets of object files needed to resolve previously unresolved symbols, it’s often necessary to list the same libraries multiple times. For background:
https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc
https://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking#circular-dependency
In this specific case, there’s a mutual dependency between wallet and server libraries, and dropping server after wallet leads to:
0 CXXLD bitcoind
1libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): In function `interfaces::(anonymous namespace)::WalletImpl::handleUnload(std::function<void ()>)':
2/home/russ/src/bitcoin/src/interfaces/wallet.cpp:444: undefined reference to `interfaces::MakeHandler(boost::signals2::connection)'
3libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): In function `interfaces::(anonymous namespace)::WalletImpl::handleShowProgress(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)>)':
4/home/russ/src/bitcoin/src/interfaces/wallet.cpp:448: undefined reference to `interfaces::MakeHandler(boost::signals2::connection)'
5libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): In function `interfaces::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)':
6/home/russ/src/bitcoin/src/interfaces/wallet.cpp:452: undefined reference to `interfaces::MakeHandler(boost::signals2::connection)'
7libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): In function `interfaces::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (boost::variant<CNoDestination, CKeyID, CScriptID, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ChangeType)>)':
8/home/russ/src/bitcoin/src/interfaces/wallet.cpp:456: undefined reference to `interfaces::MakeHandler(boost::signals2::connection)'
9libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): In function `interfaces::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (uint256 const&, ChangeType)>)':
10/home/russ/src/bitcoin/src/interfaces/wallet.cpp:462: undefined reference to `interfaces::MakeHandler(boost::signals2::connection)'
11libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o):/home/russ/src/bitcoin/src/interfaces/wallet.cpp:467: more undefined references to `interfaces::MakeHandler(boost::signals2::connection)' follow
12clang: error: linker command failed with exit code 1 (use -v to see invocation)