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 Developer
MujibAzizi
Posts: 38
Registered: ‎12-27-2010
My Device: BlackBerry Z10/Q10 - BlackBerry PlayBook
My Carrier: Vodafone NL

Can't get it working

Hi there!

 

So I tried the NDK for the first time, and I cant get it working. 

 

Basically I'm trying to build this piece of code 

#include <bps/bps.h>


int main(int argc, char *argv[]){

	bps_initialize();

	return 0;
}

 This piece of code in located in /src/main.c . When I try to build it, it gives me the following error: 

 

Description	Resource	Path	Location	Type
undefined reference to `bps_initialize'	main.c	/NewProject/src	line 13	C/C++ Problem

 

So yeah.. can you help me?

 

Thanks in advance, 
Mujib 

Please use plain text.
BlackBerry Development Advisor
anhu
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook
My Carrier: Rogers

Re: Can't get it working

I think that's a linker error. 

You need to reference libbps in the linker flags. 

Namely, when you link you need to add -lbps on your command line. 

 

One suggestion would be to look at the samples that come with the NDK and find one that does something similar to what you want to do.  Start from there and modify the code to do what you want. 

Please use plain text.
New Developer
tiggit
Posts: 9
Registered: ‎03-04-2009
My Device: Not Specified

Re: Can't get it working

The way to resolve this in the qde is to go to the project properties, and then click on Settings on the left panel.

 

Then click on the libraries item under QCC Linker in the centre of the editor. On the lower right, there are three editor panels: Library Path, Libraries and Additional Object Files

 

In the Libraries section add bps

 

You might want to add some other libraries such as screen too.

Please use plain text.