Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Executable file in release configuration bigger than in debug configuration
Qt 6.11 is out! See what's new in the release blog

Executable file in release configuration bigger than in debug configuration

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 604 Views
  • 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.
  • johngodJ Offline
    johngodJ Offline
    johngod
    wrote on last edited by
    #1

    I'm intrigued with a game I am developing in Qt 6.6.0. In Windows 11, linux Mint and MacOS Monterey, the executable file in release mode is aprox. 135MB, in debug mode is aprox. 85MB which is strange.
    I am using QtCreator default configurations, the effective qmake call

    in debug mode:

    C:/QtOpensourse/6.6.0/mingw_64/bin/qmake.exe D:\qt5projets\davidgalacticadventures\DavidGalacticAdventures.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" && C:/QtOpensourse/Tools/mingw1120_64/bin/mingw32-make.exe qmake_all
    

    in release mode:

    C:/QtOpensourse/6.6.0/mingw_64/bin/qmake.exe D:\qt5projets\davidgalacticadventures\DavidGalacticAdventures.pro -spec win32-g++ "CONFIG+=qtquickcompiler" && C:/QtOpensourse/Tools/mingw1120_64/bin/mingw32-make.exe qmake_all
    

    My pro file is

    TEMPLATE = app
    
    QT += quick multimedia quick3d gui
    
    TARGET = DavidGalacticAdventures
    
    QMAKE_CXXFLAGS += -flarge-source-files
    
    #CONFIG += c++11 #qmltypes
    #QML_IMPORT_NAME = com.estudiotecnologico
    #QML_IMPORT_MAJOR_VERSION = 1
    #INCLUDEPATH += $$PWD
    #INCLUDEPATH += $$PWD/oceanEffect
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            main.cpp \
            oceanEffect/oceaneffect.cpp \
            path.cpp \
            pathcircular.cpp \
            pathrectangular.cpp \
            placement.cpp
    
    RESOURCES += qml.qrc \
        image.qrc \
        modelDavid.qrc \
        modelGirl.qrc \
        modelHero.qrc \
        models.qrc \
        modelsBuildingsProps.qrc \
        modelsCharatersLowPoly.qrc \
        modelstest.qrc \
        skybox.qrc \
        sound.qrc \
        texturesPlanets.qrc
    
    TRANSLATIONS += \
        DavidGalacticAdventures_pt_PT.ts
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    HEADERS += \
        oceanEffect/oceaneffect.h \
        path.h \
        pathcircular.h \
        pathrectangular.h \
        placement.h
    
    
    ios {
        ios_icon.files = $$files($$PWD/ios/AppIcon*.png)
        QMAKE_BUNDLE_DATA += ios_icon
        QMAKE_INFO_PLIST = ios/Info.plist
    }
    
    DISTFILES += \
        android/AndroidManifest.xml \
        android/build.gradle \
        android/gradle.properties \
        android/gradle.properties \
        android/gradle/wrapper/gradle-wrapper.jar \
        android/gradle/wrapper/gradle-wrapper.properties \
        android/gradlew \
        android/gradlew.bat \
        android/res/values/libs.xml
    
    ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
    
    win32:RC_FILE = appicon.rc
    
    ICON = images/spaceshipAlpha.icns
    

    Google did not show me any relevant information, not sure where or what I should be looking for. Any indications are welcome.

    If it helps to show the code, this app is opensource https://bitbucket.org/joaodeusmorgado/davidgalacticadventures/src/master/

    Compiling in linux in debug mode takes aprox. 2 minutes, and 10 minutes in release mode. In windows and Mac, compilation is aprox. 10 / 12 min. in both configurations.

    jsulmJ 1 Reply Last reply
    0
    • johngodJ johngod

      I'm intrigued with a game I am developing in Qt 6.6.0. In Windows 11, linux Mint and MacOS Monterey, the executable file in release mode is aprox. 135MB, in debug mode is aprox. 85MB which is strange.
      I am using QtCreator default configurations, the effective qmake call

      in debug mode:

      C:/QtOpensourse/6.6.0/mingw_64/bin/qmake.exe D:\qt5projets\davidgalacticadventures\DavidGalacticAdventures.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" && C:/QtOpensourse/Tools/mingw1120_64/bin/mingw32-make.exe qmake_all
      

      in release mode:

      C:/QtOpensourse/6.6.0/mingw_64/bin/qmake.exe D:\qt5projets\davidgalacticadventures\DavidGalacticAdventures.pro -spec win32-g++ "CONFIG+=qtquickcompiler" && C:/QtOpensourse/Tools/mingw1120_64/bin/mingw32-make.exe qmake_all
      

      My pro file is

      TEMPLATE = app
      
      QT += quick multimedia quick3d gui
      
      TARGET = DavidGalacticAdventures
      
      QMAKE_CXXFLAGS += -flarge-source-files
      
      #CONFIG += c++11 #qmltypes
      #QML_IMPORT_NAME = com.estudiotecnologico
      #QML_IMPORT_MAJOR_VERSION = 1
      #INCLUDEPATH += $$PWD
      #INCLUDEPATH += $$PWD/oceanEffect
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
              main.cpp \
              oceanEffect/oceaneffect.cpp \
              path.cpp \
              pathcircular.cpp \
              pathrectangular.cpp \
              placement.cpp
      
      RESOURCES += qml.qrc \
          image.qrc \
          modelDavid.qrc \
          modelGirl.qrc \
          modelHero.qrc \
          models.qrc \
          modelsBuildingsProps.qrc \
          modelsCharatersLowPoly.qrc \
          modelstest.qrc \
          skybox.qrc \
          sound.qrc \
          texturesPlanets.qrc
      
      TRANSLATIONS += \
          DavidGalacticAdventures_pt_PT.ts
      
      # Additional import path used to resolve QML modules in Qt Creator's code model
      QML_IMPORT_PATH =
      
      # Additional import path used to resolve QML modules just for Qt Quick Designer
      QML_DESIGNER_IMPORT_PATH =
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      HEADERS += \
          oceanEffect/oceaneffect.h \
          path.h \
          pathcircular.h \
          pathrectangular.h \
          placement.h
      
      
      ios {
          ios_icon.files = $$files($$PWD/ios/AppIcon*.png)
          QMAKE_BUNDLE_DATA += ios_icon
          QMAKE_INFO_PLIST = ios/Info.plist
      }
      
      DISTFILES += \
          android/AndroidManifest.xml \
          android/build.gradle \
          android/gradle.properties \
          android/gradle.properties \
          android/gradle/wrapper/gradle-wrapper.jar \
          android/gradle/wrapper/gradle-wrapper.properties \
          android/gradlew \
          android/gradlew.bat \
          android/res/values/libs.xml
      
      ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
      
      win32:RC_FILE = appicon.rc
      
      ICON = images/spaceshipAlpha.icns
      

      Google did not show me any relevant information, not sure where or what I should be looking for. Any indications are welcome.

      If it helps to show the code, this app is opensource https://bitbucket.org/joaodeusmorgado/davidgalacticadventures/src/master/

      Compiling in linux in debug mode takes aprox. 2 minutes, and 10 minutes in release mode. In windows and Mac, compilation is aprox. 10 / 12 min. in both configurations.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @johngod said in Executable file in release configuration bigger than in debug configuration:

      CONFIG+=qtquickcompiler

      Maybe this makes the difference? Try to disable QtQuick compiler.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      johngodJ 1 Reply Last reply
      1
      • jsulmJ jsulm

        @johngod said in Executable file in release configuration bigger than in debug configuration:

        CONFIG+=qtquickcompiler

        Maybe this makes the difference? Try to disable QtQuick compiler.

        johngodJ Offline
        johngodJ Offline
        johngod
        wrote on last edited by
        #3

        @jsulm Thanks, that solved it, the release file now is reduced to 78 MB, lower than the debug file . I will do some performance testing, since qtcompiler should make the app faster, I'll check if it is worth the extra size.

        1 Reply Last reply
        0
        • johngodJ johngod has marked this topic as solved on

        • Login

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