Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Problems compiling and building the project
Qt 6.11 is out! See what's new in the release blog

Problems compiling and building the project

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
14 Posts 4 Posters 714 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote last edited by
    #2

    Hi,

    You should check their Windows build workflows. You'll see all the steps they take to create their release.

    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
    • K Offline
      K Offline
      kservice
      wrote last edited by
      #3

      Thank you, that's a very valuable tip! But my knowledge base is too weak to fully utilize this.
      • Since there are workflows, does that mean GitHub Actions were used?
      • I saw that MinGW runtime DLLs are imported. This explains the difference in the number of libraries.
      But how do I use this when manually using windeployqt?
      • And most importantly, I couldn't figure out what the author used for compilation: MSYS2 or MinGW. It was the compilation method that determined the huge difference in EXE size, right?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote last edited by
        #4
        1. yes
        2. you can write a script that calls windeployqt and then copy the extra dependencies
        3. msys2 is a collection of tool. MinGW was used to build the release

        You have likely built in debug mode.

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

        K 1 Reply Last reply
        1
        • SGaistS SGaist
          1. yes
          2. you can write a script that calls windeployqt and then copy the extra dependencies
          3. msys2 is a collection of tool. MinGW was used to build the release

          You have likely built in debug mode.

          K Offline
          K Offline
          kservice
          wrote last edited by
          #5

          @SGaist said in Problems compiling and building the project:
          2. you can write a script that calls windeployqt and then copy the extra dependencies
          3. msys2 is a collection of tool. MinGW was used to build the release
          You have likely built in debug mode.

          1. Everything is more or less clear with the libraries. Could you elaborate a bit on how I can do this in debug mode?
            Will I need Docker?
          2. If both the author and I used MinGW, why is there such a big difference in the .exe file size?
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote last edited by
            #6
            1. no you don't just read the content of the workflows. These are basically turned into shell scripts (more or less). You can copy the logic.
            2. Debug VS release builds, possibly some optimisation flags.

            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
            • K Offline
              K Offline
              kservice
              wrote last edited by
              #7

              Thank you for the excellent tip regarding "Debug vs. Release builds, possibly some optimization flags." This allowed me to pinpoint the reason for the discrepancy in the EXE file size. The application now launches—though only after upgrading to Qt 6.10.2 (I was previously using Qt 6.7.3).

              One question remains for future reference: which version of Qt should one use in general if the author hasn't provided specific instructions?

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kservice
                wrote last edited by
                #8

                I also forgot to ask one more thing:

                1. What tools should I use to modify the author's application (for example, to make changes to the menu, alter button labels, etc.)? As I understand it, Qt Design Studio won't be of any help here?
                2. Why am I unable to start debugging in Visual Studio? The "RUN" button is inactive. After all, it appears to be written in C++.
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote last edited by
                  #9
                  1. From a quick look, they used Designer. Qt Creator already integrates it so need for other tools.
                  2. I don't know, I am not on your machine. Silly question but: did you install the C++ stuff for Visual Studio ? They are not part of the default installation if memory serves well.

                  Any particular reason to want to use Visual Studio's compiler over MinGW ?

                  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
                  • K Offline
                    K Offline
                    kservice
                    wrote last edited by
                    #10
                    1. The C++ components for Visual Studio are installed.
                    2. There is no specific reason. I am more familiar with VS2022 than with Qt Creator, so I wanted to give it a try. However, as I understand it, it uses the MSVC compiler. And when using that compiler, I encounter a multitude of errors (moreover, fixing one error seems to trigger others). Is it possible that the code is optimized for a specific compiler (given that MinGW issues only 5–6 warnings, whereas MSVC reports 7 warnings and 15 errors)?
                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote last edited by
                      #11

                      Are these Qt specific errors or something else ?

                      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
                      • K Offline
                        K Offline
                        kservice2
                        wrote last edited by
                        #12

                        The issue is resolved, thank you.

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

                          How did you resolve it ?

                          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
                          • goldenhawkingG Offline
                            goldenhawkingG Offline
                            goldenhawking
                            wrote last edited by goldenhawking
                            #14

                            windeployqt only bundles Qt’s own libraries.

                            For MSYS2: Have an AI write a Python script with the following logic:

                            1. Recursively scan the target folder generated by windeployqt—including all subdirectories—to enumerate all executable files and DLLs. This ensures dependencies for plugins like qsqlpsql are also fully captured.
                            2. Run ldd on each file, extract all library paths starting with c:/msys64 or /c/msys64, and copy those libraries to the deployment folder.
                            3. Repeat step 1 in a loop until ldd no longer returns any library paths beginning with c:/msys64.

                            For MSVC (VC): Match the corresponding compiler version, and include the compatible vcredist_x64 redistributable when delivering the package to end users.

                            Qt is the best C++ framework I've ever met.

                            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