In addition to the packages installed while building QT6.4 I installed the following packages required for X11:
sudo apt install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev \
libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev \
libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev \
libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev \
libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev \
libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
And configured QT with dynamic linking:
export MY_INSTALL_PATH=/home/def/libs/QT6.5d
export QT_SRC_PATH=/home/def/repos/qt-everywhere-src-6.5.2
${QT_SRC_PATH}/configure -prefix $MY_INSTALL_PATH -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -opensource -confirm-license \
-c++std c++20 -openssl-linked \
-skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity \
-skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua \
-skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects \
-skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard \
-skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech -skip qtlocation \
-skip qthttpserver