My Linux has system-wide Qt 5.9.5. For testing purpose I'm trying to build Bitcoin Core against other Qt version which is installed from the official Qt's site (e.g., Qt 5.10.1):
export PKG_CONFIG_PATH=/home/hebasto/Qt/5.10.1/gcc_64/lib/pkgconfig
./configure --with-gui=qt5
make
It produces weird linker's error related to Qt itself:
CXXLD qt/test/test_bitcoin-qt
qt/test/qt_test_test_bitcoin_qt-addressbooktests.o: In function `(anonymous namespace)::EditAddressAndSubmit(EditAddressDialog*, QString const&, QString const&, QString) [clone .constprop.863]':
/home/hebasto/Qt/5.10.1/gcc_64/include/QtTest/qtest.h:70: undefined reference to `QTest::toPrettyUnicode(QStringView)'
/home/hebasto/Qt/5.10.1/gcc_64/include/QtTest/qtest.h:70: undefined reference to `QTest::toPrettyUnicode(QStringView)'
...
Makefile:4034: recipe for target 'qt/test/test_bitcoin-qt' failed
...
What am I doing wrong?