Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt for Android - Is "Bundle Qt Libraries in APK" considered as static or dynamic linking?

Tags:

c++

android

qt

I have been reading this link: https://wiki.qt.io/Licensing-talk-about-mobile-platforms and on that page, it says:

Qt for Android / Necessitas

As Qt for Android uses the LGPL version of Qt, and it's perfectly possible (and also recommended and supported) to dynamically link in the Qt libraries when creating an app - there are no problems for app developers using Qt for Android. The app developers can develop closed source code and publish the app - no worries.

Only if you statically link with the Qt libs could there be a problem with closed source apps.

So in Qt Creator, in the Build section there is a section called Qt Deployment with three options:

  • Use Ministro Service to install Qt
  • Bundle Qt Libraries in APK
  • Deploy Qt Libraries to temporary directory

If I choose, Bundle Qt Libraries in APK, is that still considered as Dynamic linking or will it be considered as static linking (even though technically it is dynamic)? It is dynamic as far as I know because inside the APK file, I can see the Qt libs. The only difference is their location.

In the folder /lib/armeabi-v7a/ there is: libQt5Core.so, libQt5Gui.so, libQt5Widgets.so etc so the libs are there so they are not statically linked but to the end user, and APK is like an EXE and it does not require external libs to download in order for the APK to run (even though technically the APK requires the Qt libs which happen to be within the APK itself) - this is why I am asking.

So to be very clear and direct, is choosing the "Bundle Qt Libraries in APK" option considered as dynamic linking?

Thanks

like image 272
rwx Avatar asked Mar 27 '16 00:03

rwx


People also ask

Is Qt dynamically linked?

Our Qt libraries have been built using dynamic linking, preventing any customer application to use them with static linking.

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.


1 Answers

It's dynamic linking. The Qt libraries are .so files, and they are bundled in the APK file. But they are still .so files, separate from the executable.

like image 181
sashoalm Avatar answered Sep 28 '22 07:09

sashoalm