Deploying Qt application, on Mac OSX and Linux, what libraries do I need to include in package?
|September 24, 2014||Posted by forumadmin under TechQns||
I am trying to package / deploy a Qt app, in Linux and mac. (Qt 4.8). I have to use shared libraries due to licensing type.
in Linux, following Qt documentation, I ran
ldd myprogram and got an output like
linux-gate.so.1 => (0xb76fa000) libOneOfMyLibs.so.1 => /usr/local/lib/libOneOfMyLibs.so.1 (0xb76d7000) libQtGui.so.4 => /usr/lib/i386-linux-gnu/libQtGui.so.4 (0xb5440000) libQtCore.so.4 => /usr/lib/i386-linux-gnu/libQtCore.so.4 (0xb501a000) ....... libgpg-error.so.0 => /lib/i386-linux-gnu/libgpg-error.so.0 (0xb4316000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb4fba000) libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb4f9c000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb4df0000) libcups.so.2 => /usr/lib/i386-linux-gnu/libcups.so.2 (0xb4d91000) libsqlite3.so.0 => /usr/lib/i386-linux-gnu/libsqlite3.so.0 (0xb4cbb000) libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb4cb6000) libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb4c99000) libfontconfig.so.1 => /usr/lib/i386-linux-gnu/libfontconfig.so.1 (0xb4c56000) libaudio.so.2 => /usr/lib/i386-linux-gnu/libaudio.so.2 (0xb4c3c000) libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb4b41000) libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xb4b14000) libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xb4a67000) libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xb4a16000) .....
very many dependencies, only some of them are Qt libs . But then they say, that since it cannot be certain what the installed program will be running, I should package all the library dependencies.
There are sooo many !!! I definitely require some of them like sqlite3. I also read that libfreetype and libfontconfig are required since they may be different on the new system.
How can I know which libs are required though ? Should I package all of them ?
The mac directions only show that I must add the Qt libraries. Even though, listing dependencies on mac, I get
myprogram.app/Contents/MacOS/myprogram: libOneOfMyLibs.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0) /usr/lib/libcups.2.dylib (compatibility version 2.0.0, current version 2.8.0) QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.6) QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.6) .... /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
on mac – do I need to add libstdc++.6.dylib and the rest ?
From Qt documentation:
“The application bundle contains the application executable as well as
dependencies such as the Qt libraries, plugins, translations and other
resources you may need. Third party libraries like Qt are normally not
installed system-wide; each application provides its own copy.”
To summarize my question:
If I do not want to make any assumptions about the system I want to deploy for, do I need to add all the system library dependencies, or only the Qt libraries, or… which are the libraries that I must add to my package ?
|Asked By – Thalia||Read Answers|