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

Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA

Label - error?

I'm trying to declare a label in my hpp file with:


Label *mLabel = new Label();


But it says 'Label' does not name a type.


What am I doing wrong?

BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Posts: 107
Registered: ‎05-11-2011
My Device: BlackBerry Z10 LE
My Carrier: AirTel

Re: Label - error?



use import statement.


#include <bb/cascades/Label>

using namespace bb::cascades;


Just declare variable in hpp file.


Label *mLabel;


and initialize it in cpp file (in constructor).


mLabel = new Label or mlabel = Label::create()