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
New Contributor
mobilityuser
Posts: 8
Registered: ‎03-21-2013
My Device: Developer
My Carrier: Developer

Creating and adding Static Library to Cascades BB10 project

Hi,

I am very new to the BB10 cascade development, i have a requirement to create a static library and add it into the project and  am able to create the static library by using static library wizard(here i used Manual option instead of makefile), it builds fine and generated the .a file. but i couldn't find any doc on how to add that to project. Could u plz some one help me on this.

Thanks

 

 

 

Please use plain text.
BlackBerry Development Advisor (Retired)
psapra
Posts: 74
Registered: ‎07-22-2008
My Device: BlackBerry Z10
My Carrier: N/A

Re: Creating and adding Static Library to Cascades BB10 project

Try using the Add Libary Wizard under top Project menu > Add Library and select External Library.

 

 

 

Thanks,
Pratik Sapra
Gaming & Apps Consultant
Developer Relations
@pratiksapra
Please use plain text.
New Contributor
mobilityuser
Posts: 8
Registered: ‎03-21-2013
My Device: Developer
My Carrier: Developer

Re: Creating and adding Static Library to Cascades BB10 project

Thanks for ur reply, i have done that but no success, i think we need to add some path to the .pro file.

 

Please use plain text.
New Contributor
mobilityuser
Posts: 8
Registered: ‎03-21-2013
My Device: Developer
My Carrier: Developer

Re: Creating and adding Static Library to Cascades BB10 project

Hi All,

Now am able to add the library to the project and compiles successfully and while linking to the library am getting the below error.

 

D:/BB_Apps/MySharedLib/Device-Debug/libMySharedLib.so: undefined reference to `vtable for MyTest'
cc: C:/bbndk/host_10_0_9_404/win32/x86/usr/bin/ntoarm-ld caught signal 1
make[2]: *** [o.le-v7-g/Test] Error 1
make[2]: Leaving directory `D:/BB_Apps/Test/arm'
make[1]: *** [debug] Error 2
make[1]: Leaving directory `D:/BB_Apps/Test/arm'
make: *** [Device-Debug] Error 2

 

Any help on this is appriciated.

Thanks

 

Please use plain text.
BlackBerry Development Advisor (Retired)
rmadhavan
Posts: 29
Registered: ‎03-19-2012
My Device: Z10
My Carrier: BELL

Re: Creating and adding Static Library to Cascades BB10 project

Please follow the instructions here step by step: http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/How-to-use-a-third-party-share...

 

I have a feeling your path in .pro file's "LIBS" variable does not exactly reflect the location. note that if you are in windows you may have to use forward slash and enclose the -L path in quotes.

 

cheers, Ram

Please use plain text.
New Contributor
hcontreras
Posts: 5
Registered: ‎04-16-2012
My Device: Curve 9300
My Carrier: Personal - Argentina

Re: Creating and adding Static Library to Cascades BB10 project

Hi mobilityuser,
I am very new to the BB10 too (newer than you). I'm trying to build an external c++ library (http://taglib.github.io/) tu use in my Cascades Projects, but unfortunatelly I couldnt make any progress on that. So dou you have an idea how to build the library and then add that library to the Momentics IDE in order to use it in my projects?.

Thanks
Please use plain text.
New Developer
swaroop7
Posts: 16
Registered: ‎10-23-2013
My Device: Z10
My Carrier: vodafone

Re: Creating and adding Static Library to Cascades BB10 project

[ Edited ]

Hi,

 

There is Standard template to create library project. Select it and compile your code static library will  get create.

After that create BB10 app project.

In this, modify .pro file as follows

 

Add INCLUDEPATH += your library header include path and

Add LIBS += -Bstatic -Lyour library path -llibrary name -Bdynamic\

 

For using QT classes in your library

 

Go to project properties->C/C++ General-> path and symbols -> includes tab -> GNU C 

add ${QNX_TARGET}/usr/include/qt4 

You will be able to work with QT classes.

 

Problem is you cannot use Cascade classes.

 

I am trying to find it out.

 

Feel free to hit like.. :smileywink:

Please use plain text.