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
Regular Contributor
Posts: 55
Registered: ‎03-14-2012
My Device: RDJ21WW
My Carrier: none

Creating Static Library

Hi,

 

I need a help regarding creating a static library in cascades. The steps I did was, New project(Blackberry c++ project)->selecting static library->selecting mode of release.

Then, project created with include folder,src and public folder. Ok .. If we build it means need to create the library libClassname.a, for me its not creating.. I dont know why?

 

Can anyone help me?

 

Thanks

Retired
Posts: 60
Registered: ‎05-10-2012
My Device: Blackberry 10 Alpha
My Carrier: none

Re: Creating Static Library

Hello,

 

When you create a static library, select the C++/Makefile build. If you choose to put your source code in the /public folder, you must modify the common.mk file to add

 

EXTRA_SRCVPATH+=$(PROJECT_ROOT)/public

 

Select the approprate build, compile and it should generate a libname.a file in the appropriate folder

 

Cheers

Selom

Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none

Re: Creating Static Library

Alternatively, you can create a normal Cascades project, and change the first line to:

TEMPLATE = lib

 

and add:

CONFIG += staticlib

 

Regular Contributor
Posts: 55
Registered: ‎03-14-2012
My Device: RDJ21WW
My Carrier: none

Re: Creating Static Library

Hello,

In cascade app, I gave the Template = lib and CONFIG +=staticlib ,but it shows the below error. What to do for it?

 

**** Build of configuration Default for project samplelib **** make Device-Debug F:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/qmake -spec unsupported/blackberry-armv7le-g++ -o arm/Makefile samplelib.pro CONFIG+=device WARNING: Failure to find: ../src/*.h F:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/qmake -spec unsupported/blackberry-x86-g++ -o x86/Makefile samplelib.pro CONFIG+=simulator WARNING: Failure to find: ../src/*.h make -C ./translations -f Makefile update release make[1]: Entering directory `F:/lib_trialworkspace/samplelib/translations' F:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/lupdate samplelib.pro Updating 'samplelib_en_GB.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'samplelib_fr.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'samplelib_it.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'samplelib_de.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'samplelib_es.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'samplelib.ts'... Found 0 source text(s) (0 new and 0 already existing) F:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/lrelease samplelib.pro Could not find qmake configuration directoryCould not read qmake configuration file F:/bbndk-10.0.4-beta/target/qnx6/usr/share/qt4/mkspecs/qmake.confUsing OS scope before setting MAKEFILE_GENERATORF:/bbndk-10.0.4-beta/target/qnx6/usr/share/qt4/mkspecs/features/static.prf(4): Using OS scope before setting MAKEFILE_GENERATORF:/bbndk-10.0.4-beta/target/qnx6/usr/share/qt4/mkspecs/features/static.prf(10): Using OS scope before setting MAKEFILE_GENERATORF:/bbndk-10.0.4-beta/target/qnx6/usr/share/qt4/mkspecs/features/uic.prf(108): Using OS scope before setting MAKEFILE_GENERATORThe directory name is invalid. Updating 'F:/lib_trialworkspace/samplelib/translations/samplelib_en_GB.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'F:/lib_trialworkspace/samplelib/translations/samplelib_fr.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'F:/lib_trialworkspace/samplelib/translations/samplelib_it.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'F:/lib_trialworkspace/samplelib/translations/samplelib_de.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'F:/lib_trialworkspace/samplelib/translations/samplelib_es.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'F:/lib_trialworkspace/samplelib/translations/samplelib.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) make[1]: Leaving directory `F:/lib_trialworkspace/samplelib/translations' make -C ./arm -f Makefile debug make[1]: Entering directory `F:/lib_trialworkspace/samplelib/arm' make[1]: Leaving directory `F:/lib_trialworkspace/samplelib/arm' Could not find qmake configuration directoryCould not find qmake configuration fileUsing OS scope before setting MAKEFILE_GENERATORmake[1]: *** No rule to make target `debug'. Stop. make: *** [Device-Debug] Error 2 **** Build Finished ****

 

Thanks

Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none

Re: Creating Static Library

Are you sure you started with the 'normal' Cascades application template? You seem to be missing some directories...