Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Why does my application become 25 times bigger!
Forum Updated to NodeBB v4.3 + New Features

Why does my application become 25 times bigger!

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 3 Posters 620 Views 1 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.
  • L Offline
    L Offline
    LyzV
    wrote on last edited by
    #1

    Hi,
    I am an embedded developer and develop C++ application for ARM7TDMI 32-bit RISC microcontroller. Size of application ~800K. Our company decided to change the microcontroller platform to SoM + linux + Qt + QtCreator. I have ported application using Qt library. I was very surprised when I saw the size of my application - 25 megabytes! The application has increased more than 25 times! I have a free version of Qt so I use Qt as lib * .so from / usr / lib. Maybe it is not? How can I tell Qt Creator to link the library at runtime?

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

      Hi,

      Are you using a static build of Qt ?

      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
      • L Offline
        L Offline
        LyzV
        wrote on last edited by
        #3

        I user Qt Creator. How can I to known?

        1 Reply Last reply
        0
        • L Offline
          L Offline
          LyzV
          wrote on last edited by
          #4

          This is example my *.pro file

          #-------------------------------------------------

          Project created by QtCreator 2019-07-25T21:40:13

          #-------------------------------------------------

          QT += core gui

          greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

          TARGET = WidgetProbe
          TEMPLATE = app

          The following define makes your compiler emit warnings if you use

          any feature of Qt which has been marked as deprecated (the exact warnings

          depend on your compiler). Please consult the documentation of the

          deprecated API in order to know how to port your code away from it.

          DEFINES += QT_DEPRECATED_WARNINGS

          You can also make your code fail to compile if you use deprecated APIs.

          In order to do so, uncomment the following line.

          You can also select to disable deprecated APIs only up to a certain version of Qt.

          #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

          CONFIG += c++11

          SOURCES +=
          main.cpp
          mainwindow.cpp

          HEADERS +=
          mainwindow.h

          FORMS +=
          mainwindow.ui

          Default rules for deployment.

          qnx: target.path = /tmp/$${TARGET}/bin
          else: unix:!android: target.path = /opt/$${TARGET}/bin
          !isEmpty(target.path): INSTALLS += target

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LyzV
            wrote on last edited by
            #5

            Sorry

            #-------------------------------------------------
            #
            # Project created by QtCreator 2019-07-25T21:40:13
            #
            #-------------------------------------------------
            
            QT       += core gui
            
            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
            
            TARGET = WidgetProbe
            TEMPLATE = app
            
            # The following define makes your compiler emit warnings if you use
            # any feature of Qt which has been marked as deprecated (the exact warnings
            # depend on your compiler). Please consult the documentation of the
            # deprecated API in order to know how to port your code away from it.
            DEFINES += QT_DEPRECATED_WARNINGS
            
            # You can also make your code fail to compile if you use deprecated APIs.
            # In order to do so, uncomment the following line.
            # You can also select to disable deprecated APIs only up to a certain version of Qt.
            #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
            
            CONFIG += c++11
            
            SOURCES += \
                    main.cpp \
                    mainwindow.cpp
            
            HEADERS += \
                    mainwindow.h
            
            FORMS += \
                    mainwindow.ui
            
            # Default rules for deployment.
            qnx: target.path = /tmp/$${TARGET}/bin
            else: unix:!android: target.path = /opt/$${TARGET}/bin
            !isEmpty(target.path): INSTALLS += target
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Check the Qt version used by the Kit you are using to build your application. Go in the corresponding folder and see if there are only .a lib files.

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

              L 1 Reply Last reply
              0
              • L Offline
                L Offline
                LyzV
                wrote on last edited by
                #7

                Thanks for the quick response! I'll look tomorrow. I do not have a project at hand.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  LyzV
                  wrote on last edited by
                  #8

                  Can I tell Qt Creator to explicitly use dynamic layout?

                  1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Check the Qt version used by the Kit you are using to build your application. Go in the corresponding folder and see if there are only .a lib files.

                    L Offline
                    L Offline
                    LyzV
                    wrote on last edited by
                    #9

                    @SGaist
                    Well, I blunted! Build for debugging. Need to switch to Release

                    JonBJ 1 Reply Last reply
                    0
                    • L LyzV

                      @SGaist
                      Well, I blunted! Build for debugging. Need to switch to Release

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by JonB
                      #10

                      @LyzV
                      Debug builds can be a bit bigger than Release ones ;-)

                      You may still be a bit optimistic if you expect to "port your application from non-Qt to Qt" and not see any difference in final size.

                      1 Reply Last reply
                      0

                      • Login

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