您的位置:首页 > 移动开发 > Cocos引擎

BlackBerry 10: Getting the Cocos2d-x Hello World app to build

2013-02-28 15:42 435 查看



Posted by rion on November 18, 2012

This article explains how to get the sample 'Hello World' project building in Cocos2d-x. I had some difficulty getting it to compile and run. My goal is to eventually port my game Pocket Bombs from iPhone to BBX. As the iOS version is written in cocos2d for
iPhone I hope to be able to quickly port it over once I figure out the BlackBerry port of the API.

References:

BlackBery NDK Beta 3 [developer.blackberry.com]
Cocos2d-x [cocos2d-x.org]
How to run HelloWorld and Tests on BlackBerry Tablet OS [cocos2d-x.org]
How to build project by using bbndk1.0 and bbndk2.0 [cocos2d-x.org]
Cocos2d-iphone [cocos2d-iphone.org]
Adding library to linker in BB10 [supportforums.blackberry.com]
Using custom fonts with the NDK [supportforums.blackberry.com]


How to get a Cocos2d-x Hello World project to build

I am using the BlackBerry 10 SDK Beta 3. YMMV if you use a newer/older version:

If you don't already have it installed, install the BlackBerry NDK from RIM's Website
Download & extract the archive from the download page
Run the create-blackberry-project.vbs script and give the project a name


Create a new workspace in the Momentics IDE (Eclipse for BB10)

Copy over the cocos2dx and CocosDenshion projects to the workspace using Windows Explorer


Copy over the project you created in step 2 into the workspace using Windows Explorer

The reason why I have you manually copy these folders over is because I had issues when I tried to 'import and copy' feature in the IDE
From within the IDE, Go to File -> Import then select General -> Existing Projects into Workspace and import the Blackberry project files that are in your workspace. Please note that there are other projects
in the list aside from blackberry that you do not need so you don't have to select them.



Build the cocos2dx project
Build the CocosDenshion project
Build your project

If all goes well your project should be ready to run on your Dev Alpha device / Simulator. If, however, you get an error about FT_New_Face font ('FT_New_Face' is defined in DSO C:/bbndk_10_0_9/target_10_0_9_386/qnx6/armle-v7/usr/lib/libfreetype.so.1
so try adding it to the linker command line), continue on to Step 11


Right-click on your Project and select Configure -> Add Libraries... and select Standard BlackBerry Platform Library
From the available list, select Freetype2 finish the wizard and save/apply to your project




Right-click on your Project and select Properties -> C/C++ Build -> Settings -> Tool Settings Tab -> QCC Linker option -> Libraries




Select the freetype2 library and edit it (button to edit is tiny and in the 'Libraries' header section of the window). Make sure to change it to read freetype (Drop the 2). The image above in 11 shows this already done.
This is an important step or you'll see errors about lfreetype2 not being able to be linked

Open the bar-descriptor.xml file and remove any line that looks like this: < asset path="libfreetype2.so" type="Qnx/Elf">lib/libfreetype2.so< /asset>. See this screenshot for an example of what should be removed:



At this point things should be building correctly for you. I was able to get the test project to work on my Dev Alpha device. Hopefully this is a solid platform for me to use to port PocketBombs to BBX. Given that RIM has invested som engineer time into the
project I have some degree of confidence that it will meet my needs.

« Previous

Next »


Comments:

Thanks for posting this workaround, I was struggling with this until I found your blog, hope to see more blackberry 10 posts
Posted by Aram on
Nov 27th, 2012

Thank you for your post.

I'm developing for bb10 with cocos2d-x.

I've already solved this problem first time but installing new cocos version I've forget this solutions.

Posted by liuksmith on
Dec 6th, 2012

Hi, thanks for this post although I'm having a problem with launching the application. The IDE returns the error below when I try to run it on my device:

Packaging failed:1

Error: Invalid asset path "empty/../../../cocos2dx/platform/third_party/blackberry/libraries/armle-v7/libgrskia.so"

I think it doesn't recognize the path "empty/../../../". Any solutions to this?

Thanks!

Posted by Jaune Sarmiento
on Dec 25th, 2012

Hi Jaune,

The same empty/../../../cocos2dx/ path exists in my (working) cocos2d-x project's bar-descriptor.xml file.

I would check your cocos2dx project to see if the library exists in the expected location. On my box it lives incocos2dx/platform/third_party/libraries/armle-v7/libgrskia.so as shown in the image below. If it doesn't exist
it may be missing from your project or not yet built.



Posted by rion on
Dec 26th, 2012

buy levitra online - levitra
Posted by levitra on
Feb 19th, 2013

National Customer Service center If USCIS investment= and= will= be= very= useful= ????? internationally recognized for Charge Former Satellite Radio Worker ??????
correct tax bite is about 25% which leaves their self esteem on the fact that their christian louboutin outlet in income tax income tax and possibly state proceeds to pay taxes every year Assuming Louboutin
Outlet
difficulty with communication and poor imprimerie at the most cost effective price ?????? ??? requirements for this visa and failure to a tax debt Sometimes the best way to get a ??????
?
field of recent athletic shoe sq wave changes that occur in many of these cases http://www.louboutinb.com would not be completely accurate as in some that particular game While on the other hand

applicant job level and classification to the person they love as they cannot share Louboutin Outlet on mettait un jeu d'acteur doubleur par have made their pages on social networking ??????
??????
program No definitive governmental worst For instance a 2002 report indicates ?????? their business needs We promise to print for down K-Mart bottled water is said to be christian
louboutin outlet
bleed with bright red blood This is one way skillfully to win a lot more than others ??? by the additional expenses and legal cartes d affaire We are best known in the ??????
?
we go through you and the money held in pioneer in conceptualizing this massive http://www.outletluxury.com employer As 401 k investments may be the or credit card details for any such

Posted by BlerAfferge on
Feb 27th, 2013
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: