Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Qt creator by default statically or dynamically link it's libraries?

Tags:

I'm developing a closed source application and to do so in accordance with the LGPL I have to dynamically link Qt's libraries to my application. Does Qt do this by default or do I have to take steps to do so? If that's the case how would I go about doing it?

like image 981
b28c92e5ff1 Avatar asked Jul 23 '12 06:07

b28c92e5ff1


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.


2 Answers

Qt uses dynamic linking by default.

You'll notice this immediately during deployment to a non-developer machine, because your code will not run without the Qt libraries.

If your concern is the LGPL, just be careful when compiling Qt itself. Most LGPL violations with Qt are not because of static linking (since dynamic is the default), but for compiling Qt with non-default parameters.

LGPL is not just that the library must be provided along your binaries, but also that you specify how your users can build themselves the LGPL part. If you compile Qt yourself and do not use the pre-compiled binaries from the website, you must document that part of your build configuration in your release!

As soon as you get something running on your program, start preparing a release version for a non-developer environment without Qt installed. Your program should fail as soon as you delete the DLLs that you must copy along your program (or whatever format your OS uses).

like image 68
SystematicFrank Avatar answered Sep 23 '22 04:09

SystematicFrank


It does it by default, statically linking seems to be quite involved judging by the many questions on the site regarding it.

like image 39
cmannett85 Avatar answered Sep 19 '22 04:09

cmannett85