Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building Qt with QT_DISABLE_DEPRECATED_UP_TO set fails
Forum Updated to NodeBB v4.3 + New Features

Building Qt with QT_DISABLE_DEPRECATED_UP_TO set fails

Scheduled Pinned Locked Moved Unsolved General and Desktop
17 Posts 3 Posters 608 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote last edited by
    #1

    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_L 1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote last edited by
      #2

      This flag is not meant for building Qt, just for your lib.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • l3u_L Offline
        l3u_L Offline
        l3u_
        wrote last edited by
        #3

        But the docs tell me to use it for my own Qt build?!

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote last edited by
          #4

          Where in the docs?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • l3u_L l3u_

            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_L Offline
            l3u_L Offline
            l3u_
            wrote last edited by
            #5

            @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".

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote last edited by
              #6

              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.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • l3u_L Offline
                l3u_L Offline
                l3u_
                wrote last edited by
                #7

                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 …

                1 Reply Last reply
                0
                • l3u_L Offline
                  l3u_L Offline
                  l3u_
                  wrote last edited by l3u_
                  #8

                  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
                  
                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote last edited by
                    #9

                    Your configure statement does not contain ´-DQT_DISABLE_DEPRECATED_UP_TO=0x060500´ ...

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    0
                    • l3u_L Offline
                      l3u_L Offline
                      l3u_
                      wrote last edited by l3u_
                      #10

                      Just read the post (where I describe the build system I use) … I exported it as an environment variable. And apparently, it was actually picked up – otherwise, the build would not fail.

                      Just try it – it's 100% reproducible …

                      1 Reply Last reply
                      0
                      • Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote last edited by
                        #11

                        Even the compiler picks this up, moc does not...

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        1 Reply Last reply
                        0
                        • l3u_L Offline
                          l3u_L Offline
                          l3u_
                          wrote last edited by
                          #12

                          Appending -- -DQT_DISABLE_DEPRECATED_UP_TO=0x060500 to the configure call instead of setting it as an environment variable did the trick. Thanks :-)

                          SGaistS 1 Reply Last reply
                          0
                          • l3u_L l3u_

                            Appending -- -DQT_DISABLE_DEPRECATED_UP_TO=0x060500 to the configure call instead of setting it as an environment variable did the trick. Thanks :-)

                            SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote last edited by
                            #13

                            @l3u_ hi,

                            Because it's not an environment variable it's a define.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            1
                            • l3u_L Offline
                              l3u_L Offline
                              l3u_
                              wrote last edited by l3u_
                              #14

                              Some small hints about the correct approach about this in the docs would be very nice 😅 – at least for clueless end-users like me …

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote last edited by
                                #15

                                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) :-)

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • l3u_L Offline
                                  l3u_L Offline
                                  l3u_
                                  wrote last edited by
                                  #16

                                  Mentioning that switch would be even better! I'll see if I can find a reasonable wording and file a bug with a patch!

                                  1 Reply Last reply
                                  0
                                  • Christian EhrlicherC Offline
                                    Christian EhrlicherC Offline
                                    Christian Ehrlicher
                                    Lifetime Qt Champion
                                    wrote last edited by
                                    #17

                                    configure --help:

                                    You can pass CMake variables as configure arguments:
                                        configure VAR=value
                                    which is equivalent to
                                        configure -- -DVAR=value
                                    

                                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                    Visit the Qt Academy at https://academy.qt.io/catalog

                                    1 Reply Last reply
                                    1

                                    • Login

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Users
                                    • Groups
                                    • Search
                                    • Get Qt Extensions
                                    • Unsolved