How to build Cocos2d-x v3.11 (and up) for Tizen

How to build Cocos2d-x v3.11 (and up) for Tizen
0.0 0


There have been topics like this one on here, and you guys made sure to help the community (with this excellent guide for instance).

I’d very much like to see that guide return into Cocos2d-x v3.12!

I did my best to follow the guide for Cocos2d-x v3.5 when trying to build Cocos2d-x v.3.11: Imported libcocos2d and cpp-test projects, changed target to Emulator, and then build.

This new Tizen SDK (v2.4) uses an external builder (ninja) to speed up the build process. It does this my generating some kind of build script prior to compiling the sources. On libcocos2d, ninja just quits with this error:

ninja -j2 all 
ninja: error: unknown build rule 'build_long_target'
build libcocos2dx.a: build_long_target external/xxtea/xxtea.o external/x...
                   ^ near here

The mentioned ‘build_long_target’ does not occur anywhere in ninja’s generated scripts (but ‘long_build_target’ does!)
Might be some kind of problem with the Tizen SDK? Sadly, i could not find anything about it on their forum.

So i tried to build with the internal build tools. After a long time compiling, it got too linking. Yay! But then, it also quits…

i386-linux-gnueabi-ar.exe -r libcocos2dx.a external\xxtea\xxtea.o external\xxhash\xxhash.o external\unzip\unzip.o <many more .o files> cocos\2d\CCActionCamera.o cocos\2d\CCAction.o 
Internal Builder: Cannot run program "i386-linux-gnueabi-ar.exe": Command line too long

Is there something i could try to get the build going?


we also have a doc here


Very nice guide!

Looks like i have done the same steps as mentioned in your documentation.
I don’t quite understand why the settings for Debug and Release need to be changed to x86, because we are building the Emulation target (and building for a physical device would need to be ARM?) But i did them anyway.

I managed to get around this weird problem with ninja by changing ‘build_long_target’ to ‘long_build_target’ in the generated file, and manually call ninja from the workspace folder:

set path=%path%;C:\Your\Path\To\tizen-sdk\tools\i386-linux-gnueabi-gcc-4.9\bin
C:\Your\Path\To\tizen-sdk\tools\ninja.exe -j2 -C cocos2d-x\build\tizen\Emulator all

This build libcocos2dx successfully! cpp-tests builds just fine from the Tizen IDE with ninja.
I’ll continue to look for a solution, building from the command-line seems like a waste of a good IDE :smile:

Forgot to mention that i’m working on Windows 10 64bit with Java 1.8.0_91 64bit and Tizen SDK 2.4 Mobile installed.
I’m using Cocos2d-x source from github (with init submodules and download-deps), fetched a few hours before i started this topic.


@owen might have some advice here.


The Emulator builds on top of X86 architecture, so that’s why you need to change the project build settings to X86.

About the command line, it seems a bug with Tizen SDK, we are working together with Samsung side to resolve this issue, after that we will also let cocos compile and cocos run commands work with Tizen.

But the progress is not that fast, so please stay tune.



Thank you @owen! Would it be possible to update this case when there is news from Samsung about this?

I’m still kind of confused about the X86 setting. The Emulator target already was set to X86 (it wouldn’t hurt to double check). But the guide tells me to change Debug and Release to X86. Did i just misunderstand?

To change either Debug or Release, right click on the libcocos2d-x project and select Properties. When this window opens, select C/C++ Build -> Tizen Settings. A few items here need to be changed. Change the properties with the red boxes on the screenshot below.

  • Choose Mobile 2.4, x86 and GCC 4.9 of the toolchain.
  • Then click the OK button.


It’s a bug related to Tizen IDE and it seems not fixed in the latest version of Tizen 2.4 Rev6.

I manually change buld_long_target under Debug/build.ninjia and disable IDE generate makefile automatically.

Then I could successfully build Tizen on my Windows 8.1 machine.

I have told this issue to Samsung guys, hope it will be fixed soon…


i read somewhere that Samsung are planing to move from android to Tizen .
so its very good move


I agree that the docs is disturbing on the settings (debug, release and emulator are well explain so why just not using emulator?), but I follow it and try other configuration to be sure.
Tizen 2.4 Rev8 and IDE are working (with cocos2d-x v3.13.1), I can build libcocos2dx, but got this errors on cpp-tests:

Any ideas?


I’ve followed the discussion and I have the same problem KompjoeFriek had. I understood how to solve it but I don’t know how to [quote=“owen, post:7, topic:29813”]
disable IDE generate makefile automatically.
I’m pretty new to eclipse so, for me, the settings look very advanced. Previously, I’ve been working just with Visual Studio for this kind of stuff.
Can you please tell me how can I do that?


@owen,@slackmoehrle Hi there is no proj.tizen when i create new project , How do I create New proj.tizen,
i tried copying from test but it doesnt compile on tizen side


I don’t think a new project is created when running cocos new

Use this:


@slackmoehrle thanks using empty tests to run my projects


How do I include extensions while building for Tizen ? I couldn’t find any equivalent for Tizen.
@owen, @slackmoehrle Please help!!
I got stuck here:
fatal error: extensions/cocos-ext.h: No such file or directory
#include “extensions/cocos-ext.h”
compilation terminated.


Change it to
#include “…/extensions/cocos-ext.h”

it will work


Now I’m getting this error:
/cocos/…/extensions/GUI/CCControlExtension/CCControlUtils.h:39:40: fatal error: extensions/ExtensionExport.h: No such file or directory
#include “extensions/ExtensionExport.h”

Do you have any solution to it ?


about the compile error, please add the include path into the Properties setting dialog:
Two options:

Project-> right click->Properties->C/C++ build ->Settings->Tool Settings->C++ Compiler-> Includes->

1.add “…/…/…/” in the Include paths(-l). The number of “…/” is related to the relative directory levels between your code file and the “extensions” folder.

2.add absolute path of “extensions” folder, for example: “/home/wql/workspace/cocosZip/cocos2d-x-3.15.1”