Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 18
Registered: ‎11-28-2012
My Device: none
My Carrier: none

how to add external libraries to .bar file

I'm working with blackberry and qt not directly with the qnx ide.


This isn't a qt related question though its more how to add files/ folders to the bar file.


I was looking at the official documentation : http://developer.blackberry.com/native/beta/documentation/com.qnx.doc.native_sdk.devguide/com.qnx.do...


It says

  • Open the BAR application descriptor file (bar-descriptor.xml) file in your project.
  • Locate the LD_LIBRARY_PATH entry and specify the folder your shared library is located when deployed on the device.
  • Save the file.
    That's not really much help as to how to actually do it.
    What I've gathered so far is that I can create some env variables in the bar descriptor.xml file and then use the app.pro file to add files or folders. I'm sorry I really don't understand this part.
    I am having trouble of a missing lib file. I created a deploy/lib folder inside the root of my test app.
    testapp/lib/deploy/file1.so, file2.so
    this is what my xml descriptor looks like

    <?xml version='1.0' encoding='utf-8' standalone='no'?>
    <qnx xmlns="http://www.qnx.com/schemas/application/1.0">
        <env value="app/native/imports" var="QML_IMPORT_PATH"/>
        <env value="app/native/plugins:/usr/lib/qt4/plugins" var="QT_PLUGIN_PATH"/>
        <env value="app/native/lib:/usr/lib/qt4/lib/" var="LD_LIBRARY_PATH"/>
        <action system="true">run_native</action>
        <asset path="gui" type="Qnx/Elf" entry="true">gui</asset>
        <asset path="/home/blubee/A/logo.png">logo.png</asset>
        <asset path="/home/blubee/A/splash.png">splash.png</asset>



    This is what my .pro file looks like

    TEMPLATE = app
    SOURCES += main.cpp mainwidget.cpp
    HEADERS += mainwidget.h
    FORMS   += mainwidget.ui
    OTHER_FILES += bar-descriptor.xml



    I hope someone here can point me to a resource that explains how to actually edit the .pro file or the .xml to be able to add additional folders and file into my .bar file.



Posts: 17
Registered: ‎07-12-2012
My Device: BB10 Alpha Device
My Carrier: none

Re: how to add external libraries to .bar file

Sorry, I don't know any resources that explain it, but you can add the .so files as assets, then make sure the path you add them to are in your LD_LIBRARY_PATH env var.


    <env value="app/native/lib:/usr/lib/qt4/lib/" var="LD_LIBRARY_PATH"/>


With those settings the only place in your bar that will be checked for libs is app/native/lib, so to put an .so in that folder you'd do something like:

    <asset path="/local/path/to/file1.so">lib/file1.so</asset>


You can also add a whole folder.  I'm doing it like this in my project:


    <asset path="Data">Data</asset>

 Hope that helps.