- Edit the .pro file to update the INCLUDEPATH to add the path of the header files of the pre-built header libraries.
INCLUDEPATH += <Path to the lib header files>
Note: if your .pro does not define INCLUDEPATH, you just add this line to .pro file.
2. Edit the .pro file to update the LIBS to add the pre-built libraries.
LIBS += -L<path to the libs> -l<lib name>
for example: if your object file is “/usr/someuser/workdir/libdummy.so”,
LIBS += -L/usr/someuser/workdir/ -ldummy
If you want to statically link with this lib (assuming you have the static version of lib under the same location), you will need to add the "-Bstatic" compiler flag for this lib and append "-Bdynamic \" at the end so that other libs will still be linked dynamically.
LIBS += -Bstatic -L<path to the libs> -l<lib name> -Bdynamic \
for example: if your object file is “/usr/someuser/workdir/libdummy.a”,
LIBS += -Bstatic -L/usr/someuser/workdir/ -ldummy -Bdynamic \
Part B: Bundle the third party shared libraries with the app to be deployed to the target.
If the third party libs are dynamically linked, you will need to update bar-descriptor.xml file to add the shared libs to be bundled with the app.
This is achieved as follows:
1. From the qde, right click the project, select Configure->Add Library...
2. choose “External Library” for Library Origin, press Next
3. Add the file path for the shared libraries accordingly.
4 . Double check the bar-descriptor.xml file to make sure the environment var “LD_LIBRARY_PATH” contains “app/native/lib”
<env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>
An Alternative method of bundling third party libs:
You can manually add the shared lib files to the project “assets”, then manually edit the value of “LD_LIBRARY_PATH" in the bar-descriptor.xml file to contain the path pointing to the bundled shared lib files.
For example, if you copy shared lib files to the “assets/myLib”, then, you will have
<env var="LD_LIBRARY_PATH" value=" app/native/assets/myLib:/app/native/lib:/usr/lib/q