PDA

View Full Version : How to add the Dll to the application??



Gokulnathvc
25th March 2011, 11:51
I have completed a project in Qt. After everything, if i run the exe alone, it says it needs that dll and 4 more dlls, Anyway the final product will be the single exe file. So how it could be achieved by including all the dlls and make working the single exe for the required application.

high_flyer
25th March 2011, 11:57
google for: static linking.

Gokulnathvc
25th March 2011, 12:03
I have searched lots and lots. Till now i didnt get any good answers. Please help me.

high_flyer
25th March 2011, 12:49
Answer to what?
Do you know what static linking is and how it is being done?

Gokulnathvc
25th March 2011, 12:53
No, i dont know how to do that also.. any sample code for that please..

BalaQT
25th March 2011, 12:56
hi gokul, Im bala. I too frm cbe. nice to meet u.

So how it could be achieved by including all the dlls and make working the single exe for the required application.
as high_flyer said, try static linking.
http://doc.qt.nokia.com/4.7/deployment.html

hope it helps,
Bala

high_flyer
25th March 2011, 13:19
No, i dont know how to do that also.. any sample code for that please..
well, then:
1. google for: static linking.
2. read about static linking.

Then you will know!

squidge
25th March 2011, 13:21
Before you statically link everything into one executable you might want to check the licensing agreements for each DLL. For example, unless you have commercial license for Qt, you must allow people to relink your application (eg, provide source or object code). Some libraries may not work correctly when statically linked.

Gokulnathvc
25th March 2011, 13:39
Hi Bala. thats great please to meet you....

Gokulnathvc
5th April 2011, 08:41
How to link the dll statically via mingwm10,libgcc_s_dw2-1,QtCore4,QtGui4,QtNetwork4???? If I copy the exe file and run in the other machine which doesnt have QT installed.It says the following dlls needed. How to link those files statically.Pls help me

peter999
5th April 2011, 12:06
There is no need for static linking. When DLLS does not work, there could be a few reasons:

1. DLL is not found in the path: (Add the path to QT and your DLLs (if any) in system settings (or start it from commandline and do a SET PATH=%PATH%;X:\PATH\TO\MY\DLLS;X:\PATH\TO\QT\BIN;
2. DLL has not the correct references: To use functions/variables in DLL, you need EXPORT/IMPORT settings. Please search for Q_DECL_EXPORT and Q_DECL_IMPORT in QT documentation...

Regards,
Peter

Gokulnathvc
5th April 2011, 13:25
http://docs.mitk.org/0.14/qxtglobal_8h.html

Here it contains the importing and exporting of the dlls but how it can be done.. Could anyone help me in this please.. How to include mingwm10,libgcc_s_dw2-1,QtCore4,QtGui4,QtNetwork4?

squidge
5th April 2011, 15:14
Just copy them to the same directory as your executable.

If you statically link you have to agree to different licenses than if you don't, therefore it's far easier to just dynamically link.

Gokulnathvc
14th April 2011, 07:12
I want to build only the exe file not the supporting files with it. How to link the dlls statically.. or adding the dlls. Just one big exe file which contains all the dlls in it

squidge
14th April 2011, 07:37
You'll need to recompile Qt - see 'Deploying Qt Applications' -> http://doc.qt.nokia.com/latest/deployment.html