aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-10-04 11:21:27 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-10-04 11:21:44 +0100
commit51c698161b54402f9a8302c9a36f28a4db01fc4f (patch)
treedacde6be9ea833f403d50cc6d228bbe2e756447e /src
parent4be785b3e33510bc5dc8fc40906fffd53de2b64b (diff)
parent5be34bacf6d07fb73a0cedfb63a384968d538f3e (diff)
Merge bitcoin-core/gui#837: qt6: Fix linking when configured with `-DENABLE_WALLET=OFF`
5be34bacf6d07fb73a0cedfb63a384968d538f3e qt: Fix linking when configured with `-DENABLE_WALLET=OFF` (Hennadii Stepanov) Pull request description: Split from https://github.com/bitcoin/bitcoin/pull/30997. When building with Qt 6 in my dev branch, I encountered a linker error when configured with `-DENABLE_WALLET=OFF`: ``` $ cmake -B build -DENABLE_WALLET=OFF -DBUILD_GUI=ON $ cmake --build build -t bitcoin-qt <snip> [100%] Linking CXX executable bitcoin-qt /usr/bin/ld: libbitcoinqt.a(rpcconsole.cpp.o): in function `QtPrivate::MetaObjectForType<WalletModel const*, void>::metaObjectFunction(QtPrivate::QMetaTypeInterface const*)': /usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h:903:(.text._ZN9QtPrivate17MetaObjectForTypeIPK11WalletModelvE18metaObjectFunctionEPKNS_18QMetaTypeInterfaceE[_ZN9QtPrivate17MetaObjectForTypeIPK11WalletModelvE18metaObjectFunctionEPKNS_18QMetaTypeInterfaceE]+0x2b): undefined reference to `WalletModel::staticMetaObject' /usr/bin/ld: libbitcoinqt.a(rpcconsole.cpp.o): in function `QMetaTypeIdQObject<WalletModel const*, 8>::qt_metatype_id()': /usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h:1313:(.text._ZZN9QtPrivate16QMetaTypeForTypeIPK11WalletModelE17getLegacyRegisterEvENUlvE_4_FUNEv[_ZZN9QtPrivate16QMetaTypeForTypeIPK11WalletModelE17getLegacyRegisterEvENUlvE_4_FUNEv]+0x53): undefined reference to `WalletModel::staticMetaObject' collect2: error: ld returned 1 exit status gmake[3]: *** [src/qt/CMakeFiles/bitcoin-qt.dir/build.make:154: src/qt/bitcoin-qt] Error 1 gmake[2]: *** [CMakeFiles/Makefile2:2107: src/qt/CMakeFiles/bitcoin-qt.dir/all] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:2114: src/qt/CMakeFiles/bitcoin-qt.dir/rule] Error 2 gmake: *** [Makefile:998: bitcoin-qt] Error 2 ``` This PR resolves the issue. ACKs for top commit: promag: ACK 5be34bacf6d07fb73a0cedfb63a384968d538f3e, all other changes in 33657e1c958146312e4c68765a92871920401396 are not required, makes the code harder to read. pablomartin4btc: tACK 5be34bacf6d07fb73a0cedfb63a384968d538f3e Tree-SHA512: d10da665384e6539b8e9106dc905ba30e9e57cd4603fc7e5eb893fc899f55f26889c570687fa5daf55c6fc5bf4fcfcfcd9b70822cfe637f31f9151bb653b7941
Diffstat (limited to 'src')
-rw-r--r--src/qt/rpcconsole.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index ae3f9aa686..20311cb631 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -16,7 +16,9 @@
#include <qt/guiutil.h>
#include <qt/peertablesortproxy.h>
#include <qt/platformstyle.h>
+#ifdef ENABLE_WALLET
#include <qt/walletmodel.h>
+#endif // ENABLE_WALLET
#include <rpc/client.h>
#include <rpc/server.h>
#include <util/strencodings.h>