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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Contributor
cellinova
Posts: 11
Registered: ‎10-05-2012
My Carrier: Rogers

undefined reference to `bb::utility::i18n::toPercentageString(double, int, int)'

Hi,

 

I'm trying to use the bb::utility::i18n apis to format a percentage string.

 

I include #include<bb/utility/i18n/Formatting> in my cpp file and call the following:

 

QString percentageStr =  bb::utility::i18n::toPercentageString(value, 4, 4);

 

However I get the following compile error:

 

/Users/proj/ndk-workspace/mm/arm/../src/Viewer.cpp:341: undefined reference to `bb::utility::i18n::toPercentageString(double, int, int)'

 

Do I have to include a specific library?

Please use plain text.
Developer
rashm2k
Posts: 18
Registered: ‎10-12-2012
My Carrier: none

Re: undefined reference to `bb::utility::i18n::toPercentageString(double, int, int)'

Yes coming from a Java background this threw me at first as well.

 

Having the method signatures separate from the source is stupid, as long as a method signature matches it will call that method which causes no end of confusion.

Please use plain text.
Contributor
cellinova
Posts: 11
Registered: ‎10-05-2012
My Carrier: Rogers

Re: undefined reference to `bb::utility::i18n::toPercentageString(double, int, int)'

But what is the library I need to link to?

Please use plain text.
Contributor
cellinova
Posts: 11
Registered: ‎10-05-2012
My Carrier: Rogers

Re: undefined reference to `bb::utility::i18n::toPercentageString(double, int, int)'

Okay I just found it.

 

 LIBS += -lbbsystem -lbbutilityi18n

Please use plain text.