I have read in the Qt docs that:
The Qt library contains hundreds of internal checks that will print warning messages when a programming error is detected. We therefore recommend that you use a debug version of Qt when developing Qt-based software.
So I want to link a “debug version of Qt” when compiling PDF4QT.
It uses CMake with vcpkg as package manager when configuring its build.
How can I do that?
I have tried appending
-DCMAKE_BUILD_TYPE=Debug to the config line, but after using
ldd on the generated binary I found out that the Release version of the Qt library is still used.
Here are the exact commands I issued:
cmake -B build_debug -S . -DPDF4QT_INSTALL_QT_DEPENDENCIES=0 -DCMAKE_TOOLCHAIN_FILE=$VCPKG_PATH/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX='/' -DCMAKE_BUILD_TYPE=Debug cmake --build build_debug --config Debug -j12
Then after compiling if I do for example
ldd ./build_debug/Pdf4QtViewerLite/Pdf4QtViewerLite I get:
libQt6Widgets.so.6 => /usr/lib/libQt6Widgets.so.6
So it’s still linked to the release build.
I have tried running the config step with
--trace-expand. Here are the logs.