Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined reference to pwalletMain et.al. when building with --disable-wallet #31

Open
echa opened this issue May 10, 2018 · 0 comments

Comments

@echa
Copy link

echa commented May 10, 2018

Hey guys, I'm trying to build straksd without wallet support and stumbled upon the following issue. Your global ptr variable pwalletMain is defined in

CWallet* pwalletMain = NULL;

which gets excluded from linking when disabling the wallet

straks/src/Makefile.am

Lines 42 to 44 in 6ddc6cc

if ENABLE_WALLET
LIBSTRAKS_WALLET=libstraks_wallet.a
endif

straks/src/Makefile.am

Lines 234 to 247 in 6ddc6cc

# wallet: shared between straksd and straks-qt, but only linked
# when wallet enabled
libstraks_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(STRAKS_INCLUDES)
libstraks_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libstraks_wallet_a_SOURCES = \
activemasternode.cpp \
wallet/crypter.cpp \
wallet/db.cpp \
wallet/rpcdump.cpp \
wallet/rpcwallet.cpp \
wallet/wallet.cpp \
wallet/walletdb.cpp \
policy/rbf.cpp \
$(STRAKS_CORE_H)

There's a couple other missing references related to the same issue, namely CCryptoKeyStore, CWallet, CActiveMasternode, and HelpRequiringPassphrase.

Here's the relevant output from building 1.14.7.3 on Alpine 3.7

  CXXLD    straksd
libstraks_server.a(libstraks_server_a-init.o): In function `AppInitMain(boost::thread_group&, CScheduler&)':
/usr/local/src/straks-1.14.7.3/src/init.cpp:1963: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/init.cpp:1963: undefined reference to `CWallet::LockCoin(COutPoint const&)'
libstraks_server.a(libstraks_server_a-mining.o): In function `masternode(JSONRPCRequest const&)':
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1235: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1276: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1317: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1317: undefined reference to `CCryptoKeyStore::Lock()'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1255: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1255: undefined reference to `CCryptoKeyStore::Lock()'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1287: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1287: undefined reference to `CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bool)'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1246: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1246: undefined reference to `CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bool)'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1323: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1367: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1367: undefined reference to `CCryptoKeyStore::Lock()'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1405: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1425: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1425: undefined reference to `CCryptoKeyStore::Lock()'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1334: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1334: undefined reference to `CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bool)'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1447: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1492: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1492: undefined reference to `CCryptoKeyStore::Lock()'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1458: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1458: undefined reference to `CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bool)'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1499: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1549: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1549: undefined reference to `CCryptoKeyStore::Lock()'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1416: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1416: undefined reference to `CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bool)'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1510: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/rpc/mining.cpp:1510: undefined reference to `CWallet::Unlock(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bool)'
libstraks_server.a(libstraks_server_a-activemasternode.o): In function `CActiveMasternode::SelectCoinsMasternode()':
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:421: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:421: undefined reference to `CWallet::AvailableCoins(std::vector<COutput, std::allocator<COutput> >&, bool, CCoinControl const*, bool, AvailableCoinsType, bool) const'
libstraks_server.a(libstraks_server_a-activemasternode.o): In function `CActiveMasternode::GetVinFromOutput(COutput, CTxIn&, CPubKey&, CKey&)':
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:405: undefined reference to `pwalletMain'
libstraks_server.a(libstraks_server_a-activemasternode.o): In function `CActiveMasternode::StopMasterNode(CTxIn, CService, CKey, CPubKey, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:179: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:179: undefined reference to `CWallet::UnlockCoin(COutPoint const&)'
libstraks_server.a(libstraks_server_a-activemasternode.o): In function `CActiveMasternode::ManageStatus()':
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:77: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:107: undefined reference to `pwalletMain'
/usr/local/src/straks-1.14.7.3/src/activemasternode.cpp:107: undefined reference to `CWallet::LockCoin(COutPoint const&)'
libstraks_server.a(libstraks_server_a-misc.o): In function `spork(JSONRPCRequest const&)':
/usr/local/src/straks-1.14.7.3/src/rpc/misc.cpp:194: undefined reference to `HelpRequiringPassphrase[abi:cxx11]()'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:3760: straksd] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant