Building Qt with QT_DISABLE_DEPRECATED_UP_TO set fails
-
Hi all,
https://doc.qt.io/qt-6/qtdeprecationmarkers.html#QT_DISABLE_DEPRECATED_UP_TO states: "If you also build Qt for yourself, including this define in your build configuration for Qt will make your binaries smaller by leaving out even the implementation of the deprecated APIs".
I just tried, having exported CXXFLAGS="-DQT_DISABLE_DEPRECATED_UP_TO=0x060500". But using this, the Qt build itself fails:
FAILED: src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o /usr/bin/c++ -DBACKTRACE_HEADER=\"execinfo.h\" -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAIR -DQT_NO_QSNPRINTF -DQT_NO_STD_FORMAT_SUPPORT -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_OPEN -DQT_USE_QSTRINGBUILDER -D_GLIBCXX_ASSERTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/global -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/kernel -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/tinycbor/src -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore/6.9.2 -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore/6.9.2/QtCore -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/double-conversion/double-conversion -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/double-conversion -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/forkfd -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/.rcc -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/mkspecs/linux-g++ -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/3rdparty/pcre2/src -DQT_DISABLE_DEPRECATED_UP_TO=0x060500 -DNDEBUG -Os -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -ffunction-sections -fdata-sections -U_FORTIFY_SOURCE -Wsuggest-override -fcf-protection=full -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -fexceptions -std=gnu++17 -ftemplate-depth=2048 -Winvalid-pch -include /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx -MD -MT src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o -MF src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o.d -o src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o -c /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp In file included from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp:378: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp: In function ‘constexpr auto Qt::qt_create_metaobjectdata() [with <template-parameter-1-1> = {anonymous}::qt_meta_tag_ZN2QtE_t]’: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1673:43: error: ‘AA_UseHighDpiPixmaps’ is not a member of ‘Qt::ApplicationAttribute’ 1673 | { 299, ApplicationAttribute::AA_UseHighDpiPixmaps }, | ^~~~~~~~~~~~~~~~~~~~ /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1680:43: error: ‘AA_EnableHighDpiScaling’ is not a member of ‘Qt::ApplicationAttribute’ 1680 | { 306, ApplicationAttribute::AA_EnableHighDpiScaling }, | ^~~~~~~~~~~~~~~~~~~~~~~ /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1681:43: error: ‘AA_DisableHighDpiScaling’ is not a member of ‘Qt::ApplicationAttribute’ 1681 | { 307, ApplicationAttribute::AA_DisableHighDpiScaling }, | ^~~~~~~~~~~~~~~~~~~~~~~~ /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1660:85: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘const QtMocHelpers::EnumData<Qt::ApplicationAttribute>::EnumEntry (&)[31]’ 1660 | QtMocHelpers::EnumData<ApplicationAttribute>(286, 286, QMC::EnumFlags{}).add({ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ 1661 | { 287, ApplicationAttribute::AA_QtQuickUseDefaultSizePolicy }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1662 | { 288, ApplicationAttribute::AA_DontShowIconsInMenus }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1663 | { 289, ApplicationAttribute::AA_NativeWindows }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1664 | { 290, ApplicationAttribute::AA_DontCreateNativeWidgetSiblings }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1665 | { 291, ApplicationAttribute::AA_PluginApplication }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1666 | { 292, ApplicationAttribute::AA_DontUseNativeMenuBar }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1667 | { 293, ApplicationAttribute::AA_MacDontSwapCtrlAndMeta }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1668 | { 294, ApplicationAttribute::AA_Use96Dpi }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1669 | { 295, ApplicationAttribute::AA_DisableNativeVirtualKeyboard }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1670 | { 296, ApplicationAttribute::AA_DontUseNativeMenuWindows }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1671 | { 297, ApplicationAttribute::AA_SynthesizeTouchForUnhandledMouseEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1672 | { 298, ApplicationAttribute::AA_SynthesizeMouseForUnhandledTouchEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1673 | { 299, ApplicationAttribute::AA_UseHighDpiPixmaps }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1674 | { 300, ApplicationAttribute::AA_ForceRasterWidgets }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1675 | { 301, ApplicationAttribute::AA_UseDesktopOpenGL }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1676 | { 302, ApplicationAttribute::AA_UseOpenGLES }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1677 | { 303, ApplicationAttribute::AA_UseSoftwareOpenGL }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1678 | { 304, ApplicationAttribute::AA_ShareOpenGLContexts }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1679 | { 305, ApplicationAttribute::AA_SetPalette }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1680 | { 306, ApplicationAttribute::AA_EnableHighDpiScaling }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1681 | { 307, ApplicationAttribute::AA_DisableHighDpiScaling }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1682 | { 308, ApplicationAttribute::AA_UseStyleSheetPropagationInWidgetStyles }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1683 | { 309, ApplicationAttribute::AA_DontUseNativeDialogs }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1684 | { 310, ApplicationAttribute::AA_SynthesizeMouseForUnhandledTabletEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1685 | { 311, ApplicationAttribute::AA_CompressHighFrequencyEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1686 | { 312, ApplicationAttribute::AA_DontCheckOpenGLContextThreadAffinity }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1687 | { 313, ApplicationAttribute::AA_DisableShaderDiskCache }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1688 | { 314, ApplicationAttribute::AA_DontShowShortcutsInContextMenus }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1689 | { 315, ApplicationAttribute::AA_CompressTabletEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1690 | { 316, ApplicationAttribute::AA_DisableSessionManager }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1691 | { 317, ApplicationAttribute::AA_AttributeCount }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1692 | }), | ~~ In file included from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore/qtmochelpers.h:1, from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:13, from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp:378: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qtmochelpers.h:335:63: note: initializing argument 1 of ‘constexpr auto QtMocHelpers::EnumData<Enum, N>::add(const QtMocHelpers::EnumData<Enum, N>::EnumEntry (&)[Added]) const [with int Added = 31; Enum = Qt::ApplicationAttribute; int N = 0]’ 335 | template <int Added> constexpr auto add(const EnumEntry (&entries)[Added]) const | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ In file included from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp:378: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:38:35: error: invalid return type ‘auto’ of ‘constexpr’ function ‘constexpr auto Qt::qt_create_metaobjectdata() [with <template-parameter-1-1> = {anonymous}::qt_meta_tag_ZN2QtE_t]’ 38 | template <> constexpr inline auto Qt::qt_create_metaobjectdata<qt_meta_tag_ZN2QtE_t>() | ^~ [13/1026] Building CXX object src/corelib/CMakeFiles/Core.dir/kernel/qcoreapplication.cpp.o
Seems like the deprecated
AA_EnableHighDpiScaling
(deprecated in 6.0.0 iirc) was removed – as requested – but it's nevertheless still used by Qt itself?!What do I do wrong?
-
This flag is not meant for building Qt, just for your lib.
-
Where in the docs?
-
Hi all,
https://doc.qt.io/qt-6/qtdeprecationmarkers.html#QT_DISABLE_DEPRECATED_UP_TO states: "If you also build Qt for yourself, including this define in your build configuration for Qt will make your binaries smaller by leaving out even the implementation of the deprecated APIs".
I just tried, having exported CXXFLAGS="-DQT_DISABLE_DEPRECATED_UP_TO=0x060500". But using this, the Qt build itself fails:
FAILED: src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o /usr/bin/c++ -DBACKTRACE_HEADER=\"execinfo.h\" -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAIR -DQT_NO_QSNPRINTF -DQT_NO_STD_FORMAT_SUPPORT -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_OPEN -DQT_USE_QSTRINGBUILDER -D_GLIBCXX_ASSERTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/global -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/kernel -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/tinycbor/src -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore/6.9.2 -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore/6.9.2/QtCore -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/double-conversion/double-conversion -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/double-conversion -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/../3rdparty/forkfd -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/.rcc -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/mkspecs/linux-g++ -I/home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/3rdparty/pcre2/src -DQT_DISABLE_DEPRECATED_UP_TO=0x060500 -DNDEBUG -Os -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -ffunction-sections -fdata-sections -U_FORTIFY_SOURCE -Wsuggest-override -fcf-protection=full -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -fexceptions -std=gnu++17 -ftemplate-depth=2048 -Winvalid-pch -include /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx -MD -MT src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o -MF src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o.d -o src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.o -c /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp In file included from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp:378: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp: In function ‘constexpr auto Qt::qt_create_metaobjectdata() [with <template-parameter-1-1> = {anonymous}::qt_meta_tag_ZN2QtE_t]’: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1673:43: error: ‘AA_UseHighDpiPixmaps’ is not a member of ‘Qt::ApplicationAttribute’ 1673 | { 299, ApplicationAttribute::AA_UseHighDpiPixmaps }, | ^~~~~~~~~~~~~~~~~~~~ /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1680:43: error: ‘AA_EnableHighDpiScaling’ is not a member of ‘Qt::ApplicationAttribute’ 1680 | { 306, ApplicationAttribute::AA_EnableHighDpiScaling }, | ^~~~~~~~~~~~~~~~~~~~~~~ /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1681:43: error: ‘AA_DisableHighDpiScaling’ is not a member of ‘Qt::ApplicationAttribute’ 1681 | { 307, ApplicationAttribute::AA_DisableHighDpiScaling }, | ^~~~~~~~~~~~~~~~~~~~~~~~ /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1660:85: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘const QtMocHelpers::EnumData<Qt::ApplicationAttribute>::EnumEntry (&)[31]’ 1660 | QtMocHelpers::EnumData<ApplicationAttribute>(286, 286, QMC::EnumFlags{}).add({ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ 1661 | { 287, ApplicationAttribute::AA_QtQuickUseDefaultSizePolicy }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1662 | { 288, ApplicationAttribute::AA_DontShowIconsInMenus }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1663 | { 289, ApplicationAttribute::AA_NativeWindows }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1664 | { 290, ApplicationAttribute::AA_DontCreateNativeWidgetSiblings }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1665 | { 291, ApplicationAttribute::AA_PluginApplication }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1666 | { 292, ApplicationAttribute::AA_DontUseNativeMenuBar }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1667 | { 293, ApplicationAttribute::AA_MacDontSwapCtrlAndMeta }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1668 | { 294, ApplicationAttribute::AA_Use96Dpi }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1669 | { 295, ApplicationAttribute::AA_DisableNativeVirtualKeyboard }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1670 | { 296, ApplicationAttribute::AA_DontUseNativeMenuWindows }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1671 | { 297, ApplicationAttribute::AA_SynthesizeTouchForUnhandledMouseEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1672 | { 298, ApplicationAttribute::AA_SynthesizeMouseForUnhandledTouchEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1673 | { 299, ApplicationAttribute::AA_UseHighDpiPixmaps }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1674 | { 300, ApplicationAttribute::AA_ForceRasterWidgets }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1675 | { 301, ApplicationAttribute::AA_UseDesktopOpenGL }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1676 | { 302, ApplicationAttribute::AA_UseOpenGLES }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1677 | { 303, ApplicationAttribute::AA_UseSoftwareOpenGL }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1678 | { 304, ApplicationAttribute::AA_ShareOpenGLContexts }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1679 | { 305, ApplicationAttribute::AA_SetPalette }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1680 | { 306, ApplicationAttribute::AA_EnableHighDpiScaling }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1681 | { 307, ApplicationAttribute::AA_DisableHighDpiScaling }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1682 | { 308, ApplicationAttribute::AA_UseStyleSheetPropagationInWidgetStyles }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1683 | { 309, ApplicationAttribute::AA_DontUseNativeDialogs }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1684 | { 310, ApplicationAttribute::AA_SynthesizeMouseForUnhandledTabletEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1685 | { 311, ApplicationAttribute::AA_CompressHighFrequencyEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1686 | { 312, ApplicationAttribute::AA_DontCheckOpenGLContextThreadAffinity }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1687 | { 313, ApplicationAttribute::AA_DisableShaderDiskCache }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1688 | { 314, ApplicationAttribute::AA_DontShowShortcutsInContextMenus }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1689 | { 315, ApplicationAttribute::AA_CompressTabletEvents }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1690 | { 316, ApplicationAttribute::AA_DisableSessionManager }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1691 | { 317, ApplicationAttribute::AA_AttributeCount }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1692 | }), | ~~ In file included from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/include/QtCore/qtmochelpers.h:1, from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:13, from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp:378: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qtmochelpers.h:335:63: note: initializing argument 1 of ‘constexpr auto QtMocHelpers::EnumData<Enum, N>::add(const QtMocHelpers::EnumData<Enum, N>::EnumEntry (&)[Added]) const [with int Added = 31; Enum = Qt::ApplicationAttribute; int N = 0]’ 335 | template <int Added> constexpr auto add(const EnumEntry (&entries)[Added]) const | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ In file included from /home/tobias/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp:378: /home/tobias/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:38:35: error: invalid return type ‘auto’ of ‘constexpr’ function ‘constexpr auto Qt::qt_create_metaobjectdata() [with <template-parameter-1-1> = {anonymous}::qt_meta_tag_ZN2QtE_t]’ 38 | template <> constexpr inline auto Qt::qt_create_metaobjectdata<qt_meta_tag_ZN2QtE_t>() | ^~ [13/1026] Building CXX object src/corelib/CMakeFiles/Core.dir/kernel/qcoreapplication.cpp.o
Seems like the deprecated
AA_EnableHighDpiScaling
(deprecated in 6.0.0 iirc) was removed – as requested – but it's nevertheless still used by Qt itself?!What do I do wrong?
@l3u_ said in Building Qt with QT_DISABLE_DEPRECATED_UP_TO set fails:
https://doc.qt.io/qt-6/qtdeprecationmarkers.html#QT_DISABLE_DEPRECATED_UP_TO states: "If you also build Qt for yourself, including this define in your build configuration for Qt will make your binaries smaller by leaving out even the implementation of the deprecated APIs".
-
I missed this sentence, sorry.
You should start over with a clean build dir - it works fine here (on windows, but this does not affect moc output wrt this topic). I can't see AA_EnableHighDpiScaling anywhere in the generated files.
Also make sure the correct moc executable is picked for generation - look in the header to see at least the version of the moc executable which created the file. -
My initial attempt was in a Ubuntu 22 LTS QEMU VM. I just tried in a naked Windows 10 VM, installed MinGW, CMake and Ninja using Qt's online installer, downloaded the qtbase sources for Qt 6.9.2, and did
set CXXFLAGS=-DQT_DISABLE_DEPRECATED_UP_TO=0x060500
.Very same result as on Ubuntu:
FAILED: src/corelib/CMakeFiles/Core.dir/global/qglobal.cpp.obj ... In file included from C:/Qt/qtbase-everywhere-src-6.9.2/src/corelib/global/qglobal.cpp:378: C:/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp: In functi on 'constexpr auto Qt::qt_create_metaobjectdata() [with <template-parameter-1-1> = {anonymous}::qt_met a_tag_ZN2QtE_t]': C:/Qt/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qnamespace.cpp:1673:43: e rror: 'AA_UseHighDpiPixmaps' is not a member of 'Qt::ApplicationAttribute' 1673 | { 299, ApplicationAttribute::AA_UseHighDpiPixmaps }, | ^~~~~~~~~~~~~~~~~~~~ ...
And here, there's no chance that some system-widely installed moc has been used, as there's none …
-
My configure statement was:
..\configure ^ -release ^ -static ^ -optimize-size ^ -prefix C:\Qt\6.9.2_static ^ ^ -no-feature-androiddeployqt ^ -no-feature-macdeployqt ^ -no-feature-concurrent ^ -no-feature-dbus ^ -no-feature-printsupport ^ -no-feature-testlib ^ -no-feature-textmarkdownreader ^ -no-feature-textmarkdownwriter ^ -no-feature-textodfwriter ^ -no-feature-xml ^ ^ -no-opengl ^ -no-gif ^ -no-ico ^ -qt-libjpeg ^ -qt-libpng ^ ^ -no-sql-odbc ^ -no-sql-mysql ^ -qt-sqlite
-
Your configure statement does not contain ´-DQT_DISABLE_DEPRECATED_UP_TO=0x060500´ ...
-
Even the compiler picks this up, moc does not...
-
Appending
-- -DQT_DISABLE_DEPRECATED_UP_TO=0x060500
to theconfigure
call instead of setting it as an environment variable did the trick. Thanks :-) -
There is also the
-disable-deprecated-up-to
configure option (just discovered while checking Qt's sources).You can open a ticket on the bug tracking system for the documentation to be improved. Even better, you can also submit a patch to make the improvement yourself (highly appreciated) :-)
-
configure --help:
You can pass CMake variables as configure arguments: configure VAR=value which is equivalent to configure -- -DVAR=value