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
Contributor
fabiobh
Posts: 33
Registered: ‎11-21-2012
My Device: Blackberry Playbook

How to correct add Box2D to blackberry project using cocos2d-x

Hi,

I use the cocos2d-x framework,
I have a game that runs fine on android and iOS, but when I try to  create the project inside QNX Momentics, It tell that can't find box2d.h, how is the correct way to add box2d to a blackberry project in cocos2d-x?

Please use plain text.
Developer
MikePembo951
Posts: 107
Registered: ‎02-15-2012
My Device: Blackberry Playbook 32GB

Re: How to correct add Box2D to blackberry project using cocos2d-x

Take a look here and you'll find box2d. Could try and compare your project to the box2d files on the github.

Please use plain text.
Contributor
fabiobh
Posts: 33
Registered: ‎11-21-2012
My Device: Blackberry Playbook

Re: How to correct add Box2D to blackberry project using cocos2d-x

I succesfully add the box2d file

 

Previous I use

#include "Box2d.h"

But it not work

 

now I use the 

#include "Box2D/Box2d.h"

 

and works, but I still have an error:


../../../../external/Box2D/proj.blackberry/Device-Debug/libBox2D.a: No such file: No such file or directory Bricks C/C++ Problem

 

any idea of how to resolve that?

Please use plain text.
New Contributor
ThomasRiisbjerg
Posts: 8
Registered: ‎06-08-2011
My Device: Playbook & Dev Alpha B

Re: How to correct add Box2D to blackberry project using cocos2d-x

I don't have Momentics in front of me, so this is all from memory, but you generally want to make sure that you've built the Box2D project in Momentics, which will produce the library file libBox2D.a in the Device-Debug directory. Then make sure your Bricks project references the library file. Right click on the Bricks project, select Properties, expand the C++ item and find the linker input settings. Add a file from your workspace and then select libBox2D.a from your Box2D project in the Device-Debug folder.
Please use plain text.
Contributor
fabiobh
Posts: 33
Registered: ‎11-21-2012
My Device: Blackberry Playbook

Re: How to correct add Box2D to blackberry project using cocos2d-x

Unfortunately I think it's a bug from Momentics, because I already have the libBox2D.a file in the respective Device-Debug folder, but when I try to compile, Momentics can't find the file.

I'll try to add the file like you said, I'll post the result here, thanks

Please use plain text.
Contributor
fabiobh
Posts: 33
Registered: ‎11-21-2012
My Device: Blackberry Playbook

Re: How to correct add Box2D to blackberry project using cocos2d-x

ThomasRiisbjerg, I can't find the 'linker' option that you said.

I open the properties, but i find two C++ options:

C/C++ Build and C/C++ General,

But no one of them have the linker option inside it.

Can you help me?

Please use plain text.
New Contributor
ThomasRiisbjerg
Posts: 8
Registered: ‎06-08-2011
My Device: Playbook & Dev Alpha B

Re: How to correct add Box2D to blackberry project using cocos2d-x

Project properties -> C/C++ Build -> Settings -> QCC Linker

Please use plain text.
Contributor
fabiobh
Posts: 33
Registered: ‎11-21-2012
My Device: Blackberry Playbook

Re: How to correct add Box2D to blackberry project using cocos2d-x

I found it, thank you very much

Please use plain text.
New Contributor
ThomasRiisbjerg
Posts: 8
Registered: ‎06-08-2011
My Device: Playbook & Dev Alpha B

Re: How to correct add Box2D to blackberry project using cocos2d-x

Did that solve your linker error?

Please use plain text.
Contributor
fabiobh
Posts: 33
Registered: ‎11-21-2012
My Device: Blackberry Playbook

Re: How to correct add Box2D to blackberry project using cocos2d-x

Yes, it resolved, thanks.
Please use plain text.