Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++, Qt - How do I get rid of dll dependencies?

Tags:

c++

dll

qt

I have compiled my Qt application and now have the following question - now my built project requires QtCore4.dll and QtGui4.dll to be located at the same folder where the .exe file is. (I built my project using MSVS2008 with Qt addon)

Q:

Is there any way to combine my final application with these .dll files so that they make one large .exe-file? (I simply don't want to have another bunch of dll files with my release - app)

Thank you.

like image 603
Yippie-Ki-Yay Avatar asked Jun 05 '10 17:06

Yippie-Ki-Yay


2 Answers

You need to build and link to Qt statically.

Edit: Here's an updated link to at least similar information.

like image 132
Jerry Coffin Avatar answered Sep 30 '22 00:09

Jerry Coffin


Bundle them into a self-extracting .exe (e.g. using 7zip) which extracts all files to a temporary directory, runs the program, then deletes the files after the program exits.

This will be easier, less time consuming and less legally constraining than statically linking Qt as previously suggested.

like image 29
rohanpm Avatar answered Sep 30 '22 02:09

rohanpm