Welcome!

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

Reply
Developer
Posts: 188
Registered: ‎04-07-2013
My Device: BlackBerry Z10
My Carrier: Telus
Accepted Solution

Using Third Party Library

[ Edited ]

Hello, I am planning to use a 3rd party library in my cascades app.

 

I have downloaded it from GitHub and I have compiled and generated the libNAME.so file.

 

How do I use this library in my app?? Could anyone guide me please? I have read the KB articles but it is not clear enough.

 

Thank you!

 

 

jayvdiyk.com
Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Using Third Party Library

right click on the project, configure, add library, external library.
If the library has includes you add them in the pro file:
INCLUDEPATH += $$quote($$BASEDIR/IncludeDir)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 188
Registered: ‎04-07-2013
My Device: BlackBerry Z10
My Carrier: Telus

Re: Using Third Party Library

Do I only need the *.so file Or do I still need the whole library project folder?

 

and

 

INCLUDEPATH += $$quote($$BASEDIR/IncludeDir)

 

IncludeDir is the directory of the *.so file, am I right?

 

Thanks for the reply!

 

 

jayvdiyk.com
Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Using Third Party Library

no, the so file is somewhere else, i put it in a lib folder, but it is still linked with the full path, dunno if you can change that to a relative path somehow as it is in the pri file which is autogenerated.

the include dir has header files in my case
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 188
Registered: ‎04-07-2013
My Device: BlackBerry Z10
My Carrier: Telus

Re: Using Third Party Library

Thank you!
jayvdiyk.com
Highlighted
Developer
Posts: 147
Registered: ‎05-31-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: Bonbon

Re: Using Third Party Library

[ Edited ]

I consider this to be a bug in QNX Momentics. Aboslute paths used in config.pri for adding library, yet everything else uses a relative path.

I solved it somewhat differently.

 

Manually added a library as an asset from a project subfolder ./lib/ (You do that in Build Configuration Profiles in bar-descroptor.xml)

 

Added following lines into my .pro file:

device {
	LIBS += -L$$_PRO_FILE_PWD_/lib -lSomeSharedLibrary
	PRE_TARGETDEPS +=  $$_PRO_FILE_PWD_/lib
}

 It does give you more control over your relative path parameter.

Of course, it doesn't have to be wrapped into device block if you built it for both device and simulator.