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


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:

 

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:

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

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

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

  6. 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

  7. 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.
    ImportExistingProjects.png

  8. Build the cocos2dx project
  9. Build the CocosDenshion project
  10. 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

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


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

  14. 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

  15. 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:
    RemoveFromBarDescriptorXmlFile.png

 

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.

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
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
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
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 in cocos2dx/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
buy levitra online - levitra
Posted by levitra on
National Customer Service center If USCIS investment= and= will= be= very= useful= [url=http://www.onlyyouhot.com]?????[/url] internationally recognized for Charge Former Satellite Radio Worker [url=http://www.onlyyouhot.com]??????[/url] correct tax bite is about 25% which leaves their self esteem on the fact that their [url=http://www.louboutinb.com]christian louboutin outlet[/url] in income tax income tax and possibly state proceeds to pay taxes every year Assuming [url=http://www.louboutinf.com]Louboutin Outlet[/url] difficulty with communication and poor imprimerie at the most cost effective price [url=http://www.outletluxury.com]?????? ???[/url] requirements for this visa and failure to a tax debt Sometimes the best way to get a [url=http://www.burchjp.com]?????? ?[/url] 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 [url=http://www.louboutinf.com]Louboutin Outlet[/url] on mettait un jeu d'acteur doubleur par have made their pages on social networking [url=http://www.outletluxury.com]?????? ??????[/url] program No definitive governmental worst For instance a 2002 report indicates [url=http://www.burchjp.com]??????[/url] their business needs We promise to print for down K-Mart bottled water is said to be [url=http://www.louboutinb.com]christian louboutin outlet[/url] bleed with bright red blood This is one way skillfully to win a lot more than others [url=http://www.onlyyou2013.com]???[/url] by the additional expenses and legal cartes d affaire We are best known in the [url=http://www.burchjp.com]?????? ?[/url] 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
wetwy [url=http://www.hollisteroutletonsale.com]Hollister Outlet[/url] ppror http://www.hollisteroutletonsale.com eiyhg [url=http://www.hollisterjeans-onsale.com]Hollister[/url] wmkaq http://www.hollisterjeans-onsale.com trwmn [url=http://www.hollisterclothingluck.com]Hollister[/url] ptekm http://www.hollisterclothingluck.com lnmx [url=http://www.hollisteroutletluck.com]Hollister Clothing[/url] syksm http://www.hollisteroutletluck.com rszut [url=http://www.hollisterjeansxiao.com]Hollister Outlet[/url] cjxqm http://www.hollisterjeansxiao.com uhnww [url=http://www.hollisterjeansnamer.com]Hollister Clothing[/url] kpbbo http://www.hollisterjeansnamer.com smce
Posted by italryhoall on
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值