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
Developer
Ebscer
Posts: 880
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha

Cocos2dx compile error

When compiling the TestCocos2dx project against a release build I get the following error:

D:\bbndk-2.0.0-beta3\host\win32\x86\usr\bin\ntoarm-ld: ../../../cocos2dx/platform/third_party/qnx/libraries\libvorbis.a(vorbisfile.o): relocation R_ARM_MOVW_ABS_NC against `__stack_chk_guard' can not be used when making a shared object; recompile with -fPIC

 WIth a simulator build configuration the build works properly, but will not load onto the simulator, instead giving the following error:

Packaging failed:1
Error: File or dir does not exist: D:\bbndk-2.0.0-beta3\target\target-override\x86\usr\lib\libbps.so

 To be fair, that file does not seem to exist.

 

Has anyone had success getting any Cocos2dx projects to run?


Read my thoughts on BlackBerry Development at news.ebscer.com
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Cocos2dx compile error

Gday,

 

I was able to get Cocos2DX and its samples up and running without hitting these issues.

 

For the second issue could you go open the bar-descriptor.xml file and then go to the "Assets" tab and delete any reference to libbps? This is not longer needed in NDK 2.0.

 

Actually, you may be best to re-sync from Github (if using an older pull of Cocos2DX) and use the following steps to compile the samples:

1) Compile the cocos2dx library project

2) Import the cocos2dxtests project right from cocos2dx library directory

3) Compile cocos2dxtests

 

Check to ensure that cocos2dx is getting rebuilt if you change the build configuration.

 

Regards,

 

Garett
@garettBeuk
--
Goodbye everybody!
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Cocos2dx compile error

Make sure you are checking out from the "next" branch on github.  The "master" branch has some legacy workarounds for the older NDK (specifically the libbps override).

 

Cheers,

Sean

Developer
Ebscer
Posts: 880
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha

Re: Cocos2dx compile error

Removing libbps seemed to clear up the one issue but now I am seeing the following warning when trying to install on the simulator

 

Packaging failed:1
Error: File or dir does not exist: D:\bbndk-2.0.0-beta3\target\target-override\x86\usr\lib\libOpenAL.so

 Removing libOpenAL.so also resulted in more errors

 

I downloaded the next branch and the project built without errors, but didn't contian any binaries that I could deploy to the device or simulator. Mixing it with the other projects doesn't seem to work either.

 

Any chance that this is due to me running beta versions of OS 2?

'


Read my thoughts on BlackBerry Development at news.ebscer.com
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Cocos2dx compile error

The binaries are built before deployment, so it should nothing to do with the OS you are running on your device. 

 

What steps are you following to compile?

Garett
@garettBeuk
--
Goodbye everybody!
New Contributor
mr_x408
Posts: 7
Registered: ‎02-16-2012
My Device: Playbook Simulator

Re: Cocos2dx compile error

[ Edited ]

EDIT: I was having the same problem,

When you go to build the app make sure you build the cocos2dx and other files first that will solve the issue

New Contributor
germanmartinez
Posts: 5
Registered: ‎02-23-2012
My Device: playbook

Re: Cocos2dx compile error

I had the same problem, when updating to OS 2.0 and NDK 2.0 the project compiles but does not get uploaded to the device. What I did was copy the files reported as missing from the same folder of the NDK 1.0 installation path and after that all problems where gone and now I can upload the application.

Maybe there is a better solution, if you know one please let me know :smileyhappy:
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Cocos2dx compile error

There shouldn't be any missing files reported, if there is then it is likely that you are using an outdated version of Cocos2DX

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
moadib
Posts: 24
Registered: ‎02-06-2012
My Device: developer

Re: Cocos2dx compile error

replace

${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib/libbps.so

with

${QNX_TARGET}/${CPUVARDIR}/usr/lib/libbps.so

in bar-descriptor.xml

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Cocos2dx compile error

In NDK 2.0/PlayBook OS 2.0 there is no need to include reference to the bps lib at all from your project, it will already reside on the device. Removing this line altogether should still allow it to compile.

Garett
@garettBeuk
--
Goodbye everybody!