[Interest] static build for android and ios

Hamish Moffatt hamish at risingsoftware.com
Tue Jul 14 12:59:31 CEST 2015


On 14/07/15 18:35, Gian Maxera wrote:
> The advantage on mobile is the size of the App.
> Qt is made of module, if you compile it statically, you don’t have a giant big library, but a lot of static modules.
> So, every module link against (at least) QtCore … that means you have a lot of duplication of static code to link against it
> and the result will be a bigger app full of duplication of object code.
>
> Another advantage is the startup time. A static app is a big .exe to put fully on the memory before to start the app. That means if your app is bigger of 40Mb at startup your mobile device need to fully load it into memory before start the app.
> If it’s dynamic link, the library are loaded only when needed. That means, if your app is only 2Mb of code, you load at startup only 2Mb and then when some features are needed the corresponding library is loaded.
>

Yes dynamic libraries are great if you can share them with other apps, 
but on iOS you can't. Even if dynamic linking were allowed you can't 
actually share libraries with another app anyway. Firstly you are 
sandboxed and can't access its files, and secondly there are no 
inter-dependencies between apps so what would you do if the other app 
wasn't installed?

As to startup time, the dynamic linker has to load your libraries (open 
them at least) to do the linking so I think you're incorrect. In theory 
the kernel doesn't need to load your whole static application either, 
just load the code as it needs it. And in either case pages can be 
thrown away and loaded back into RAM as required.


Hamish



More information about the Interest mailing list