How to make my qt app as standalone .exe , [SOLVED]
-
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...
-
Also copy the platform dependent files!! folder: platform!!
-
[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
- this file Transitions_again (my app name, i just started learning Qt!)
-
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!!!
-
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 -
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. -
[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
-
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 :) -
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 -
[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 :)
-
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