How to compile Qt app with specify version dependency (Linux)
-
Hello there,
I'm not sure how to describe it correctly, but I have a following problem.
I need to compile my Qt application with exactly dependency to specific Qt version. Currently when I compile my app on linux and try
@ldd Application@
I'm getting following result
@...
libQtCore.so.4 => /usr/local/Trolltech/...
...@What I would like to achieve is this:
@libQtCore.so.4.8.2 => /usr/local/Trolltech/...@
The reason for this requirement is a deployment of my app. I would like to distribute my App together with default Qt libraries in one directory. I already updated rpath to APP/libs directory and everything works fine, until I tried to distribute my app to system with newer version of Qt.
In such cases I'm getting a following error:
@Cannot mix incompatible Qt library .....@
Thank you for any suggestions.
Ludek -
Compile statically. Be very careful about licensing, though. You need to make your app licensed under either GPLv3, or commercial.
Alternatively, take a look at how Qt Creator works - it bundles it's own version of Qt libraries on every platform, independent from OS Qt.
-
Thank you for reply. Unfortunately I can't use static link because of license restriction. I'm using free version of Qt and I don't want to distribute it under GPL.
I will take a look at Qt creator distribution, but some simpler example would be a better ;-)
Thanks.
-
No need to examine the whole source code, just take a look at qtcreator.pro and shell scripts used to run it.