PDA

View Full Version : question about dlls..



"BumbleBee"
7th April 2011, 13:02
Is there any way to make qt apps not ask for the dlls(mingw10,guid....)?
I need to to upload my program and let people to download.
I don't want them to download 190MB(exe+dlls)...so...

Thank you.

Archa4
7th April 2011, 13:17
Hm... U doing something wrong
I think u add the ...d.dlls (like QtCore4d.dll). Those are Debug dll's and u don't have to include them, add those without d.dll's (like QtCore4.dll).

Zlatomir
7th April 2011, 13:18
You are building the "debug" version of your application, that has a lot of information in it for the debugger... that is meant for you to use while fix the bugs, it is not for your clients to use. (note the d in the Qt dll names: QtGuid4.dll)

For your clients you build the "release" (after you fixed all the bugs ;) ) and deploy that with example dll: QtGui4.dll (without that d) and the two MinGW and Qt's core and gui have about 13MB.

"BumbleBee"
7th April 2011, 13:25
You are building the "debug" version of your application, that has a lot of information in it for the debugger... that is meant for you to use while fix the bugs, it is not for your clients to use. (note the d in the Qt dll names: QtGuid4.dll)

For your clients you build the "release" (after you fixed all the bugs ;) ) and deploy that with example dll: QtGui4.dll (without that d) and the two MinGW and Qt's core and gui have about 13MB.

Aha...so in release mode i don't have to put the dlls in the same folder with exe?
And I didn't understand what you wrote here:deploy that with example dll: QtGui4.dll (without that d) and the two MinGW and Qt's core and gui have about 13MB.

Archa4
7th April 2011, 13:31
Aha...so in release mode i don't have to put the dlls in the same folder with exe?
No. U have to put the dll's in your folder but u've put the wrong ones...


QtGui4.dll (without that d) and the two MinGW and Qt's core and gui have about 13MB.
When u build your release version include the QtGui4.dll, mingwm10.dll and QtCore4.dll

squidge
7th April 2011, 13:32
Static application will not be much smaller than dynamic application.

190MB seems unusally large though, what files are you putting with your application?

Eg. deploy QtGui4.dll, do not deploy QtGui4d.dll

Zlatomir
7th April 2011, 13:35
Aha...so in release mode i don't have to put the dlls in the same folder with exe?...
You still need to copy the dlls, but you will copy the release versions example: QtGui4.dll, QtCore4.dll and so on for the Qt modules you used in your application.
You don't copy the QtGuid4.dll, QtCored4.dll dlls which are bigger.

On my system QtGui4.dll is 9 MB and QtGuid4.dll is 147 MB, the release dlls are much smaller and also the release build is more optimized and it will run faster.

"BumbleBee"
7th April 2011, 13:44
Can I somehow include the dlls in my app(like compile or something..)so that the user cannot see the dlls?
I want to give the exe only.

Archa4
7th April 2011, 13:48
U have to read about static linking... I would tell u about it but the thing is - i have no idea how to use it...

Zlatomir
7th April 2011, 13:57
To create a static application you will need to static build Qt framework (http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_ gcc) your self and if you use open source Qt, check what you are and are not allowed to do, because LGPL has some restrictions.

"BumbleBee"
7th April 2011, 15:08
What is this static framwaork and why does it say about gcc?

Zlatomir
7th April 2011, 15:26
Qt is a framework and you need the static build of the framework if you want to build static application that use the Qt framework.

The link was just an example, it says the procedure to build Qt static on Windows using MinGW (MinGW is the compiler used and it is a Windows port of the GCC)

"BumbleBee"
7th April 2011, 15:33
When you say build you mean some coding I have to do in my application to make the exe run alone(without dlls) on other pcs?

Zlatomir
7th April 2011, 15:44
No,

When i said build i meant you need to build the Qt framework - since what is already built (the dlls) are not for static use.
//coding is already done, you just need to build the Qt framework static, and then link your application with the static Qt framework you built earlier.

And you will need to check with MinGW documentation on how to static link the MinGW run-time (so that you don't need those two dlls for MinGW)

And if you didn't buy commercial license, you also need to make sure you still obey LGPL license.

"BumbleBee"
7th April 2011, 16:12
Would it be easy to build that static fra..?
BTW:I build my app in release mode and it dosn't execute..exits with code: -1073741511

Zlatomir
7th April 2011, 16:22
The 1073741511 exit code means wrong dlls, did you deployed your application with the correct dlls, also check that you don't have some "older" invalid paths or check your "windows\system32" dir and see if there is any Qt dll's.

Archa4
8th April 2011, 07:30
Would it be easy to build that static fra..?
BTW:I build my app in release mode and it dosn't execute..exits with code: -1073741511

There are a few copies of some dll's (they have the same name but different size), so it's possible u added the wrong ones...

"BumbleBee"
13th April 2011, 19:36
The 1073741511 exit code means wrong dlls, did you deployed your application with the correct dlls, also check that you don't have some "older" invalid paths or check your "windows\system32" dir and see if there is any Qt dll's.

Need to fix this ASAP(I need to build in release to make file like 20 mb instead of 200 as it's now.)
In release folder it shows this:http://min.us/lmHCMO

Thank you.

ChrisW67
14th April 2011, 02:30
I assume you are using the Qt SDK with its included MingW compiler. Here are the points form the above discussion summarised:

Deploy the release DLLs (e.g. QtCore4.dll), not the debug DLLs (e.g. QtCored4.dll). This is the most likely reason that your deployment is ridiculously large. A full set of release libraries, which you are unlikely to need all of, is about 40MB.
Deploy the DLLs that have been built with the same compiler as your executable. This means you should deploy the DLLs found in

\Qt\2010.02.1\qt\bin,
not the ones in \Qt\2010.02.1\bin
(adjust the path as required). This is the most likely cause of your latest problem. Don't forget to deploy any plugin that your application requires. This is the most likely cause of the next problem you are likely to strike.

The issue of what to deploy and where to put it has been done to death in these forums.

Gokulnathvc
20th April 2011, 08:54
How to include all the dlls into the application and making the large exe file instead of copying the dll's and installing them in the installed folder..... Need to include al thte Dll's needed before release..

squidge
20th April 2011, 11:30
Then you need to rebuild Qt and use static linking. You also need to read the license agreement about static linking.

ChrisW67
21st April 2011, 00:05
Or use one of the many installer scripting programs to build a single installer executable that installs the multiple files you need to deploy.

Gokulnathvc
25th April 2011, 06:37
I just need a single large executable file with all the dll's statically linked. Help me regarding this.

squidge
25th April 2011, 09:37
We've already told you how to do this - you need to rebuild Qt.

Gokulnathvc
25th April 2011, 11:46
Could you explain this with the sample code..??:confused:

nish
25th April 2011, 11:49
Could you explain this with the sample code..??:confused:
linking is a different process than coding. There is no sample code for that. You need to learn how to configure and make.

Gokulnathvc
25th April 2011, 11:58
I need to link the following dlls,
libgcc_s_dw2-1.dll,mingwm10.dll,QtCore4.dll,QtGui4.dll,QtNetwor k4.dll.
How to link them statically?
These dll's are needed for my application to run.

"BumbleBee"
25th April 2011, 13:13
Man,according to what they have said,you cannot bind all that into one executable.
A method that I know,you can use is to make a SFX archieve(self extracting RAR),which will have the appearence of an .exe,but will extract itself behind the scenes.

Otherwise,you'll need to re-build Qt,which means take the source code and re-complite it...

squidge
25th April 2011, 14:02
I need to link the following dlls,
libgcc_s_dw2-1.dll,mingwm10.dll,QtCore4.dll,QtGui4.dll,QtNetwor k4.dll.
How to link them statically?
These dll's are needed for my application to run.Your not going to get a different answer by just asking the same question. You need to reconfigure the build of Qt, then rebuild Qt, and then rebuild your application.

How to do that is described here: http://doc.qt.nokia.com/latest/deployment.html

Note that static linking requires a different license than dynamic linking. Therefore ensure you read the license first or you may get sued.

john_god
25th April 2011, 19:09
You guys really should google about setup creators, like inno setup or click team install creator, wich are free and spend 5 minutes learning how to use them, because they are easy to learn. If you really want to do a static building than read the docs that already have been pointed out. I did it once and worked, althougt I don't think it's worth the trouble because of the license and because it's much easy to use a setup program. Your programs will look more "professional"

positive_4_life
25th April 2011, 20:48
Your not going to get a different answer by just asking the same question. You need to reconfigure the build of Qt, then rebuild Qt, and then rebuild your application.

How to do that is described here: http://doc.qt.nokia.com/latest/deployment.html

Note that static linking requires a different license than dynamic linking. Therefore ensure you read the license first or you may get sued.
Out of curiosity, who will sue? Trolltech?

squidge
25th April 2011, 21:05
No, Nokia, as Nokia owns the license to the non-commercial version of Qt.

DanH
26th April 2011, 12:33
On Symbian (and, I think, Maemo) you can use the "smart installer" that will download missing DLLs. The source for the smart installer is, I believe, "open", so you could presumably adapt it for another platform (though it would be a lot of work).