Take this magic tool and look what DLL You need.
P.S.
And read how to deploy Qt application.
Take this magic tool and look what DLL You need.
P.S.
And read how to deploy Qt application.
Last edited by Lesiok; 15th November 2012 at 09:52.
Lesiok, Please read the question again. You are giving links to sites I linked above myself. I know what DLLs the program needs and I already read (linked) the article about deploying. Total amount of DLLs I added is around 80 MBs and the "empty" product is still not working.
I am waiting answers from people who are actually able to read the question. Please dont waste my time with stupid and irrelevant answers.
Tnx in advance.
Musti.
--Addition. Or just say that QT is not able to create standalone(static) or light weight (dynamic) programs like Visual C++ or Visual Basic so I can stop wasting my time for a program that incapable.
Last edited by zupermustafa; 15th November 2012 at 16:20.
You are quite able to create lightweight programs using Qt dynamic libraries but you have to understand that you are comparing apples and oranges. The 'lightweight' programs you get from Visual C++ are dependent on collections of DLLs, C++ runtimes, or .Net runtime environments that are assumed present on any Windows machine and are often, therefore, not present in the application bundle. The 200k-400k VB games you so fondly recall were dependent on a several megabytes of Visual Basic runtime and supporting files installed into Windows directories, i.e. the supporting files were 4-5 times larger than the program executable (Since XP you can assume these are already present). Qt does not have the luxury of assuming its DLLs and plugins are present and you must ship them with your application.
First be sure you have built and are deploying a release mode application, which you claim to have done. The debug versions of the application and libraries (e.g. QtCore5d.dll) are much larger and unnecessary. Do not deploy DLLs you are not using, the basic hello world GUI requires QtCore, QtGui, and QtWidgets but not QtWebkit. Second, you must deploy any imageformat and similar plugins that are required by your program. These do not show in Dependency Walker unless you run the program in the profiler, and even then it loads all available plugins, not just the ones your require. Skipping this second step is most likely why your applications starts but silently fails. Deploying plugins has been repeatedly covered in this forum.
You can also use UPX or something similar to compress the DLLs further although this is generally unnecessary if you use any sort of installer because these generally compress their payload for transmission.
You can also build a static Qt application, by building a static Qt, building your application with that, and living with the technical and licensing restrictions that may impose. You need the Qt source code and its dependencies in order to build a static Qt. I don't know if the source is included in the 500MB binary distribution you have, but if there is no "configure" or "configure.exe" anywhere on your machine then I guess that answers the question.
Both deployment options are shown on the page you list and its parent page, but you should be reading the deployment page for the Qt 5 version you have in case anything of substance has changed. It is installed in Assistant and available here.
If you really cannot handle deploying a few files to support your executable then I suggest you use Microsoft's tools, stick exclusively to .Net 3.0, abandon support for XP which has no .Net by default, and abandon any cross-platform ability.
Last edited by ChrisW67; 15th November 2012 at 23:19.
All this time 2 answers and both of them are wrong.
I contacted some old friends to get the answer which is actually very simple. IT IS NOT POSSIBLE TO WRITE LIGHT PROGRAMS WITH QT
The guy above mentioned some rubbish about needing libraries. Maybe true but that wasnt my question. I am able to write a 50KB program with visual basic or visual C++ and send it to all my friends. They can all use it. Vista, 7, XP, CentOS, Knuppix, etc...
So, to see the ignorance of this community I am kindy asking again making the question as simple as possible. I tested the question on my 3 year old nephew and he understood the question so I am hoping you guys will understand it this time.
1. Is it possible to write a simple program that would be below 100KBs? I hope you guys know what KB means.
2. If yes, write a 2+2 program and tell me all the steps you need to do to create the final product.
3. Note that the program must be cross-platform. I should be able to use it on all linux and windows operating systems.
I am asking not the get an answer but to see the capacity of this community. I started learning C++ 2 weeks ago on my spare times and I see I already know more than guys above. Thats simply sad.
Hoping to get an sensible answer this time.
Musti.
Has anyone really been far even as decided to use even go want to do look more like?
Last edited by amleto; 18th November 2012 at 13:53.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Lol...
Lol...I contacted some old friends to get the answer which is actually very simple. IT IS NOT POSSIBLE TO WRITE LIGHT PROGRAMS WITH QT
Qt Code:
#include <QtGui> int main(int argc, char **argv) { l.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
$ ls -sh prog
8,0K prog
For me it is pretty much lightweight (main.o is only 3KB, the rest is GCC startup code)
Please send your Visual Basic program to me too, I'd like to use it. You can attach it as a zip archive to your post so that we can all download it. The program can be as simple as displaying a red text "I know how to deploy my apps" in a window. If you want a more demanding task, create a Visual Basic app displaying QtCentre.org website in a window. Additional points for fitting it inside 10kB (my Qt app doing this is 12kB, with main.o being 3kB again and the rest, the linking and GCC initialization code and it took me about 2 minutes to write it, build it and test it).The guy above mentioned some rubbish about needing libraries. Maybe true but that wasnt my question. I am able to write a 50KB program with visual basic or visual C++ and send it to all my friends. They can all use it. Vista, 7, XP, CentOS, Knuppix, etc...
Yes and there is no reason to treat people as if they were stupid asking them whether they knew what "KB" meant, that's plain rude.1. Is it possible to write a simple program that would be below 100KBs? I hope you guys know what KB means.
See above. It's not 2+2 but rather a simple "hello world" app (so it does more than your "2+2 program"). Steps required to build and run on any LSB Linux are qmake -project, qmake, make, run the executable. You can also transfer the sole executable and run it on any LSB 3.2+ Linux (LSB stands for "Linux Standard Base", most Linux distros nowadays are LSB compliant) with the same architecture.2. If yes, write a 2+2 program and tell me all the steps you need to do to create the final product.
Be my guest, let's make the code Public Domain -- take it, do whatever you want with it. There is nothing platform specific in this code, you can build it on any Qt-supported platform.3. Note that the program must be cross-platform. I should be able to use it on all linux and windows operating systems.
I will be very blunt here. I think it is more than rude to spend 2 weeks of spare time on learning something and claim to have eaten all the answers on the subject, come to any community devoted (even remotely) to that language and behave like you are behaving. I can understand your irritation (regardless if it is right or not) but that doesn't justify your behaviour. Especially that your problems have nothing to do with the language.I started learning C++ 2 weeks ago
And I can easily prove you are wrong with your and your friends' "knowledge". Create a simple 2+2 app using Visual Studio 2010 (possibly even 2008 or even 2005 in case of Win2k) and then run it on vanilla Windows 2000 or Windows XP (by vanilla I mean that nothing has been added to the system after it has been installed, like when launching the system for the first time). When you finally stop scratching your head as why it didn't work as you had expected it to, come back here and write "I'm sorry for misdjudging this community and possibly offending people who had tried to help me". Then spend some more time on learning the tools you like to use. Perhaps some page on MSDN on deploying applications in Windows environment will prove helpful (as I understand it is Windows platform that you're battling with right now, apps are usually easier to deploy in U**x environment than in Windows).
Unfortunately it is something else that is sad... And again I can prove you wrong. We know how to run our apps, you don't, so how come can you know more than we do?on my spare times and I see I already know more than guys above. Thats simply sad.
As homework, do this -- launch your beautiful 50KB Visual Basic (or Visual C++) game and check how much memory it occupies in total (I'm not talking about what the Windows task manager displays, that's rubbish). It will probably occupy much much more than several megabytes of RAM. Now ponder, if the code for your app is only 50kB, what is contained in the rest of the memory used by the process? Where does the remaining code come from? Another hint: the clever program you are using for checking the amount of memory occupied should tell you how much memory is used by code, how much by data and how much by stack. Let's not care about stack right now and focus solely on code and data.
Really?
Explain to me how you make a VB program run on a CentOS or Knuppix [sic] system and I won't consider this a load of unmitigated rubbish.I contacted some old friends to get the answer which is actually very simple. IT IS NOT POSSIBLE TO WRITE LIGHT PROGRAMS WITH QT
The guy above mentioned some rubbish about needing libraries. Maybe true but that wasnt my question. I am able to write a 50KB program with visual basic or visual C++ and send it to all my friends. They can all use it. Vista, 7, XP, CentOS, Knuppix, etc...
As I explained above, you are comparing apples and oranges. Your 50kB Visual Basic executable only works because all of the libraries that it cannot possibly function without are already deployed with any modern Windows. If you include all the dependent libraries for either a modern VB or Qt program in your size-of-application assessment you'll find they are comparable. If you assess size purely on the size of the main executable then, once again, they are comparable. If you compare the size of one option's bare executable against another option's total deployed size then you are not comparing likes.
Simple questions, simple answers.So, to see the ignorance of this community I am kindy asking again making the question as simple as possible. I tested the question on my 3 year old nephew and he understood the question so I am hoping you guys will understand it this time.
Yes you can, and yes I know what kB means.1. Is it possible to write a simple program that would be below 100KBs? I hope you guys know what KB means.
Sure, I'll even make gratuitous use of Qt even though it is not required for this example:2. If yes, write a 2+2 program and tell me all the steps you need to do to create the final product.
Size of program < 100kB (even smaller if built on Linux, probably a little smaller if built with Microsoft C++)Qt Code:
Y:\tt>type main.cpp #include <QApplication> #include <QLabel> int main(int argc, char **argv) { label.show(); return app.exec(); } Y:\tt>qmake -project Y:\tt>qmake CONFIG+=release Y:\tt>mingw32-make mingw32-make -f Makefile.Release ... Y:\tt>dir release Volume in drive Y is VBOX_tmp Volume Serial Number is 0000-0822 Directory of Y:\tt\release 19/11/2012 11:35 AM 1,497 main.o 19/11/2012 11:36 AM 59,904 tt.exe 2 File(s) 61,401 bytes 0 Dir(s) 76,253,519,872 bytes freeTo copy to clipboard, switch view to plain text mode
Deployment to another machine involves ensuring all the dependencies are present on the target machine. This is required for deployment of any program, written with any tools, on any platform. If your VB.Net application use .Net 4.5 then you need to deploy the ~50MB .Net 4.5 run time to Windows 7 machines, if it uses Qt 5 then you need to deploy (some) Qt5 libraries, if it uses Java then you need to deploy a Java runtime and classes. See the pattern?
Total deployment bundle size about 5 MB.Qt Code:
Y:\tt>mkdir deploy Y:\tt>copy release\tt.exe deploy 1 file(s) copied. Y:\tt>copy c:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtCore4.dll deploy 1 file(s) copied. Y:\tt>copy c:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\QtGui4.dll deploy 1 file(s) copied. Y:\tt>copy c:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\mingwm10.dll deploy 1 file(s) copied. Y:\tt>copy c:\QtSDK\Desktop\Qt\4.8.0\mingw\bin\libgcc_s_dw2-1.dll deploy 1 file(s) copied. Y:\tt>dir deploy Volume in drive Y is VBOX_tmp Volume Serial Number is 0000-0822 Directory of Y:\tt\deploy 02/04/2012 02:00 PM 43,008 libgcc_s_dw2-1.dll 02/04/2012 02:00 PM 10,135,040 QtGui4.dll 19/11/2012 11:36 AM 59,904 tt.exe 02/04/2012 02:00 PM 11,362 mingwm10.dll 02/04/2012 02:01 PM 2,843,136 QtCore4.dll 5 File(s) 13,092,450 bytes 0 Dir(s) 76,240,388,096 bytes free Y:\tt>"c:\Program Files\7-Zip\7z.exe" a -r deploy.zip deploy ... Y:\tt>dir deploy.zip Volume in drive Y is VBOX_tmp Volume Serial Number is 0000-0822 Directory of Y:\tt 19/11/2012 11:45 AM 5,345,534 deploy.zip 1 File(s) 5,345,534 bytes 0 Dir(s) 76,235,026,432 bytes freeTo copy to clipboard, switch view to plain text mode
Of course, you don't need Qt for a 2+2 program, and if you don't use Qt then you don't need to deploy Qt.
By your definition of lightweight, i.e. the size of a complete installer for the program, then any non-trivial Qt GUI program for deployment to an out-of-the-box Windows will not be 'lightweight' but that total size does not grow with lines-of-code. The less trivial the program the less of an overhead. After the first time you deploy this to a machine the executable can be replaced alone: a total of less than 100 kB.
Well, that certainly counts out your Visual Basic comparison. You can compile and run the program above on Windows XP, Vista, 7, 8, Linux, Mac OS X, and possibly Android and embedded systems. It may run on Windows 2000 also.3. Note that the program must be cross-platform. I should be able to use it on all linux and windows operating systems.
If you don't want to deploy anything other than your program executable to any Windows system then I have already given you your option.
Last edited by ChrisW67; 19th November 2012 at 02:46.
Try with static building:
1. Install QtSDK (2009.05)
2. Open your mkspecswin32-g++qmake.conf file (located in C:\Qt\2009.05\qt\mkspecs\win32-g++\qmake.conf) in an editor like notepad.
3. Find the line that starts with "QMAKE_LFLAGS = -enable-stdcall-fixup..." and ddd the phrase "-static" (without quotes) after the "=" sign and before the "-enable..." phrase, so it looks like:
QMAKE_LFLAGS = -static -enable-stdcall...
4. Save and close this file.
5. Set your environment variables. Right-click Computer >> Properties >> Advanced System Settings >> Click the "Environment Variables..." button.
6. Under "User variables," make sure QTDIR is set to your Qt path (C:\Qt\2009.05\qt). Make sure QMAKESPEC is set to win32-g++.
7. Under "System variables," edit the one called "Path." Add a semicolon ( ; ) to the end, and add the following:
C:\Qt\2009.05\mingw\lib;C:\Qt\2009.05\mingw\bin;C: \Qt\2009.05\qt\bin
8. When finished, relog or reboot.
9. Open a command prompt.
10. Change to your Qt directory by entering: cd C:\Qt\2009.05\qt
11. Enter the following: configure -static -no-phonon -no-phonon-backend -release -no-exceptions
12. When it asks which edition you want to use, enter "o" for open source.
13. When it asks you to accept the terms of the license, enter "y" for yes. This will take around maybe 10 minutes to complete.
14. When that finishes, enter the following: mingw32-make sub-src (or) nmake sub-src
15. Go out to dinner, this will take a while (took between 1-2 hours for me).
16. When this finishes, open your project in the Qt Creator.
17. Double-click the project (.pro) file to open it in edit mode.
18. Add the following line: CONFIG += static
19. qmake Hello.pro
nmake release (or) mingw32-make release
20. Navigate to your release directory and voila! Your standalone executable should be there.
zupermustafa (30th November 2012)
Thank you Gokulathvc for giving exactly what I asked for. While others got lost in my attitude, you actually listed an excellent answer.
To all others. My problem was version 5.0 which had some bugs preventing the process. All this time I provoked you all to see this problem but you all got lost in your angers. Solution was simple. "I was using the wrong version".
Thanks Gokul... for actually giving a proper answer. I am writing this so others who have the same problem can benefit from it.
Added after 31 minutes:
I checked the lines and there are some minor differences with what I did .
open QT command prompt it has to be QT command prompt
C:\Qt\2010.05\qt>configure -platform win32-g++ -static -release -no-exceptions (this takes around 10 minutes)
C:\Qt\2010.05\qt>mingw32-make sub-src (takes around 40 minutes)
You do those two sections individually. It takes damn long time.
After that in Name.pro section you type this in the end
CONFIG += static
You also have to do that in your program or it doesnt work. I havent really tasted it for major programs yet but it fixes my minor problem so far.
Last edited by zupermustafa; 30th November 2012 at 07:35.
Bookmarks