Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

170 MB Hello World -> Deploying apps with Qt

I'm new to Qt but no problem in the C++. I used Qt Creator and made a simple program with a button (like a hello world) then I built the project. I was not able to run the executable file in windows itself (outside the creator) because it needed these DLL files:

libgcc_s_dw2-1.dll
mingwm10.dll
QtGuid4.dll
QtCored4.dll

I found these files and put them beside the exe. Now the program works but the folder has a size of 170 MB because of the big Dll files. Is this a way of deploying Qt applications. I know their's a way to make a standalone static app but that's not the problem. I'm ok with the dlls but the dependencies seem to be too big. Is there a different method of deploying projects with smaller file sizes?

Thanks

like image 559
Auxiliary Avatar asked Sep 09 '10 09:09

Auxiliary


People also ask

Can you make mobile app with Qt?

There is support for Android development in Qt 6. With Qt Creator, you can connect to devices, develop, test, and package Android applications. Note: Qt user apps require using the same NDK r23b version used for building the official Qt for Android libraries.

How do I create an APK in Qt?

Note: In Qt Creator, select Projects > Build > Build Steps > Build Android APK > Open package location after build to build the application's . apk and open the directory containing the package.

How do I run a Qt app on Android?

In order to use Qt for Android, you need the following: Java Development Kit (JDK) provided by AdoptOpenJDK for all platforms, is required to build Android apps. Other alternatives such as OpenJDK for Linux or Java SE Development Kit for Windows are also supported.


2 Answers

Why don't you do a release build and use the release dlls instead of the debug dlls which are much larger.

Since this is regarding size:

Debug libraries

QtCored4.dll = ~37MB

QtGui4d.dll = ~157MB

Release libraries

QtCore.dll = ~2.3Mb

QtGui4.dll = ~9MB

(from looking at the sizes in my Qt\version\bin directory)

like image 81
radix07 Avatar answered Oct 11 '22 12:10

radix07


you have two problems here:

  • "procedure entry point not found": you have multiple versions of Qt libraries installed. Not good. You are linking against import library A, while at runtime your executable finds a dll B, which is not the one you linked against. Check your project output while linking to see which import library VS uses. Easiest solution: delete/uninstall everything Qt related and start over cleanly. Adjust your project settings likewise.
  • not finding the dlls at runtime: solution is to add the directory with qt dlls to your PATH
like image 40
stijn Avatar answered Oct 11 '22 13:10

stijn