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. How to make my qt app as standalone .exe , [SOLVED]
QtWS25 Last Chance

How to make my qt app as standalone .exe , [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
17 Posts 4 Posters 13.6k 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.
  • K Offline
    K Offline
    kamhagh
    wrote on 16 Jun 2014, 09:55 last edited by
    #1

    hi

    i first tried to follow qt guide to do it i got confused i dont know exactly what it means by < any other options you need>

    here---> http://qt-project.org/doc/qt-4.8/deployment-windows.html#creating-the-application-package

    sorry if this thread is bad or asked already, but i couldn't figure out !

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kamhagh
      wrote on 16 Jun 2014, 09:56 last edited by
      #2

      i also tried the appname.exe from realease insideqt creator it sais qt5core.dll is missing!

      1 Reply Last reply
      0
      • A Offline
        A Offline
        arsinte_andrei
        wrote on 16 Jun 2014, 10:41 last edited by
        #3

        when you export apps in Qt, you also have to add to the working folder - where the main exe file id the qt5core.dll and depending on how and what module are you including with it you may also to add that library too. like Qt5cored.dll and libgcc_s_dw2-1.dll and so on.. any way after you have build your exe, move the new generated files your app files into a new folder and try to run it there - best is to move it into another computer that has no Qt installed in order to establish correctly all the dependency that your project have at if is the same machine the PATH arg will disturb you and it won't give you accurate information but if you are running on machine without Qt then you will see al the dll that your app require in order to work. this is how I'm doing. probably someone else have a better point of view and way of doing but at the moment this is me...

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jeroentjehome
          wrote on 16 Jun 2014, 11:27 last edited by
          #4

          Also copy the platform dependent files!! folder: platform!!

          Greetz, Jeroen

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kamhagh
            wrote on 16 Jun 2014, 11:34 last edited by
            #5

            [quote author="arsinte_andrei" date="1402915290"]when you export apps in Qt, you also have to add to the working folder - where the main exe file id the qt5core.dll and depending on how and what module are you including with it you may also to add that library too. like Qt5cored.dll and libgcc_s_dw2-1.dll and so on.. any way after you have build your exe, move the new generated files your app files into a new folder and try to run it there - best is to move it into another computer that has no Qt installed in order to establish correctly all the dependency that your project have at if is the same machine the PATH arg will disturb you and it won't give you accurate information but if you are running on machine without Qt then you will see al the dll that your app require in order to work. this is how I'm doing. probably someone else have a better point of view and way of doing but at the moment this is me...[/quote]

            sorry but i read that like 10 times still dont get it,

            what do you mean also have to add to the working directory, copy build files (like myapp.ui) to the realease folder? my qt is on E:\Software\Qt\Qt 5.3.0
            and my projects are on E:\Libraries\Documents\Qt_proj\

            theres build-Transitions_again-Desktop_Qt_5_3_0_MinGW_32bit-Release

            • this file Transitions_again (my app name, i just started learning Qt!)
              whats main exe file id ? there are no qt5core in anywhere btw
            1 Reply Last reply
            0
            • K Offline
              K Offline
              kamhagh
              wrote on 16 Jun 2014, 11:41 last edited by
              #6

              you mean mingw482_32\plugins?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                arsinte_andrei
                wrote on 16 Jun 2014, 11:44 last edited by
                #7

                ok.. you have created a folder with your source code. and you have another folder with the compiled data. now into the compiled folder you have the @Desktop_Qt_5_3_0_MinGW_32bit-Release @ hare you have many files and two folders debug and release folder. debug has to be empty for release apps. so you have your app compiled into an exe. I assume that you have installed Qt under the C:\Qt. because you are using MinGW 32 bit you have to go to C:\Qt\5.3\mingw482_32\bin\ and from here to copy the asking dll. that the app will ask for before it will start running. the platform independent file suppose to be also in the folder release you will find there not only the Transitions_again.exe but even some *.o files copy all the files into the release folder from the bin under the Qt and voila - WORKING!!!

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kamhagh
                  wrote on 16 Jun 2014, 11:49 last edited by
                  #8

                  theres only 3 makefiles not so many:| in realease i did what you said , still doing it, seems to take so long!:O

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kamhagh
                    wrote on 16 Jun 2014, 11:52 last edited by
                    #9

                    not again another error: Entry Point Not Found
                    _z21qRegisterResourceDataiPKJ bla bla bla could not be located in dunamic link library (folder dir)

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      arsinte_andrei
                      wrote on 16 Jun 2014, 11:55 last edited by
                      #10

                      run qMake again in the release.. you've been under debug until now...
                      somehow a cmmon release problem when people forget to run qMake when they change from release to debug or the other way
                      please see here "more details":http://qt-project.org/forums/viewthread/31160

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kamhagh
                        wrote on 16 Jun 2014, 12:51 last edited by
                        #11

                        i damaged my qt creator let me install it again !

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          arsinte_andrei
                          wrote on 16 Jun 2014, 12:56 last edited by
                          #12

                          what??? how?? btw use "TotalCommander ":http://www.ghisler.com/
                          that will be very good with search feature Alt-F7 and also matching the dll for you you can filter and also have many other good stuff too. like that you will never damage your Qt again... or you will destroy your computer... be carefully a sword with two edges.

                          1 Reply Last reply
                          0
                          • J Offline
                            J Offline
                            JKSH
                            Moderators
                            wrote on 16 Jun 2014, 13:46 last edited by
                            #13

                            [quote author="arsinte_andrei" date="1402915290"]best is to move it into another computer that has no Qt installed in order to establish correctly all the dependency[/quote]No need.

                            Just rename the folder which contains Qt. Then, your computer will think that Qt is not installed.

                            [quote author="kamhagh" date="1402919575"]another error: Entry Point Not Found
                            _z21qRegisterResourceDataiPKJ bla bla bla could not be located in dunamic link library (folder dir)[/quote]That means you copied the wrong version of the DLLs.

                            Some questions:

                            • Did you take any files from _\Tools\QtCreator\bin_? You shouldn't, because this folder is private.
                            • Do you have Qt or MinGW in your PATH? If so, remove them.
                            • Do you have multiple versions of Qt installed? If so, uninstall the ones that you don't need.

                            After you have checked the above, follow this simple guide: http://qt-project.org/wiki/Deploy_an_Application_on_Windows

                            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              kamhagh
                              wrote on 16 Jun 2014, 13:53 last edited by
                              #14

                              i took everything from bin! i got minGw as compiler.. what doyou mean in your patch =?? i had Qt on my secondary HDD e: as i damaged some files :D i installed again but on c: this time (my windows partitions its my ssd , its only 120gb) i put build on realease mode and press build
                              i saw the folder named : "E:\Libraries\Documents\Qt Proj\build-Cute_main-Desktop_Qt_5_3_0_MinGW_32bit-Release" (my saving projects directory!) and i went to release and i saw cute_main.exe there, so i opened it it asked me for many different files, i put them from bin one by one. it asked for many different ones, finally it gave the error , i uninstalled the old 5.1.1 still the same! im seeing what that guide is :)

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                arsinte_andrei
                                wrote on 16 Jun 2014, 13:59 last edited by
                                #15

                                what is the error that it came up after you have put all the files?
                                are you shure that you've took all the files from C:\Qt\5.3\mingw482_32\bin? hope not from \Tools\QtCreator\bin? witch is wrong!!!.
                                also yes, can you delete the old folder of Qt from D: and to rename (as a better approach - for the sake of PATH ) c:\Qt to something else like C:\myQt; temporary - you will rename it back to Qt after your exe is working properly

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  kamhagh
                                  wrote on 16 Jun 2014, 14:05 last edited by
                                  #16

                                  [quote author="JKSH" date="1402926378"][quote author="arsinte_andrei" date="1402915290"]best is to move it into another computer that has no Qt installed in order to establish correctly all the dependency[/quote]No need.

                                  Just rename the folder which contains Qt. Then, your computer will think that Qt is not installed.

                                  [quote author="kamhagh" date="1402919575"]another error: Entry Point Not Found
                                  _z21qRegisterResourceDataiPKJ bla bla bla could not be located in dunamic link library (folder dir)[/quote]That means you copied the wrong version of the DLLs.

                                  Some questions:

                                  • Did you take any files from _\Tools\QtCreator\bin_? You shouldn't, because this folder is private.
                                  • Do you have Qt or MinGW in your PATH? If so, remove them.
                                  • Do you have multiple versions of Qt installed? If so, uninstall the ones that you don't need.

                                  After you have checked the above, follow this simple guide: http://qt-project.org/wiki/Deploy_an_Application_on_Windows[/quote]

                                  ahaha thanks its finally done ! :) my first qt c++ app that find text but doens't show it probably :D (the color change is sooooo minimal, hard to notice no idea how to chance it ,)

                                  thanks so much trying to reduce the huge file size :)

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    arsinte_andrei
                                    wrote on 16 Jun 2014, 14:14 last edited by
                                    #17

                                    please if you have accepted this as a solution and is fine for you to rename the title by editing the first post and add [SOLVED] to it

                                    1 Reply Last reply
                                    0

                                    2/17

                                    16 Jun 2014, 09:56

                                    topic:navigator.unread, 15
                                    • Login

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