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
pqzzny
Posts: 4
Registered: ‎02-26-2013
My Device: Playbook

Having trouble getting the Belligerent Blocks sample app to build

Hi all,

 

I'm interested in developing a 2D game for BB10, and the Belligerent Blocks example looks like it would have loads of good info.  The only problem is that I can't get it to build.  I've downloaded the source code, the Box2D code, and the latest SDK, but I can't figure out how to make it all work.  When I try to build it, it says that it can't find Box2D.h.  i've tried google, scouring the forums, and everything I can think of in the IDE, but I just can't get it to work.  Can anyone provide me with an **bleep**-proof guide to setting this up?

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Having trouble getting the Belligerent Blocks sample app to build

README says

 - Box2D installed or added as a project dependency

I think you missed this requirement

New Contributor
pqzzny
Posts: 4
Registered: ‎02-26-2013
My Device: Playbook

Re: Having trouble getting the Belligerent Blocks sample app to build

I didn't miss it, I just couldn't figure out how to do it.

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Having trouble getting the Belligerent Blocks sample app to build

Did you download/compile Box2D? https://github.com/blackberry/Box2D

New Contributor
pqzzny
Posts: 4
Registered: ‎02-26-2013
My Device: Playbook

Re: Having trouble getting the Belligerent Blocks sample app to build

Yes, I downloaded it and followed the instructions in building.txt and built it in Momentics, but I don't know how to get Belligerent Blocks to recognize it.

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Having trouble getting the Belligerent Blocks sample app to build

Try adding to your Makefile a line including a folder that has Box2D folder

INCLUDEPATH += yourBox2Dfolderhere

New Contributor
pqzzny
Posts: 4
Registered: ‎02-26-2013
My Device: Playbook

Re: Having trouble getting the Belligerent Blocks sample app to build

Same error after doing that.  I think I could just copy all of the files in to the Belligerent blocks folder and change where it looks for the headrs in every .cpp file, but I'd really rather not.

Developer
jalue
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10

Re: Having trouble getting the Belligerent Blocks sample app to build

Yeah, I've tried adding Box2D to the NDK include area and it seemed to help, but I was getting errors for 'sinf' and 'cosf' with suggestions of changing it to std::sinf and std::cosf...  So the build didn't work.

Developer
jalue
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10

Re: Having trouble getting the Belligerent Blocks sample app to build

[ Edited ]

Well, I finally got the Box2D to build the library... I also had to add in the include directory for Box2D so that Blocks could find the header files.  Now it's telling me that the build for Blocks cannot use the Box2D library because it's incompatible... Joy...

 

Any help would be appreciated. Thanks in advance.

 

--Edit--

 

Nevermind.. I changed the Build Configuration so that both are the same.. Unfortunately, Blocks doesn't have a Simulator-Debug option and Box2D doesn't have a Simulator option...

 

And copying configuration settings from one to the other and vice versa doesn't work.

 

Anyone have a BB Z10 they can send me?  :smileyhappy:

 

Upon further digging around, I got it to build.  Just had to change the target CPU for Box2D.

Developer
jalue
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10

Re: Having trouble getting the Belligerent Blocks sample app to build

[ Edited ]

What worked for me is to add the directory just before Box2D into your Paths and Symbols area for the Belligerent Blocks Properties, because the header files Blocks is looking for is in Box2D/....

 

For instance:  E:\Blackberry\ndk-10.0.9-workspace\Box2D

Add into Paths and Symbols - Includes:  E:/Blackberry/ndk-10.0.9-workspace

Also, be sure to have the Target CPU for Box2D as whatever CPU you have instead of for the Device (Arm).. Which was my mistake, although you're using the PB ....