iosjsoncocos2d-js

Cocos2d - json/document.h file not found


I create a mobile game using cocos2d framework. The problem is I got this error when I try to compile ios platform.

In file included from /Users/MNurdin/Documents/Game/WTP/frameworks/js-bindings/bindings/manual/chipmunk/js_bindings_chipmunk_manual.cpp:26:
In file included from /Users/MNurdin/Documents/Game/WTP/frameworks/js-bindings/bindings/proj.ios_mac/../../cocos2d-x/extensions/cocos-ext.h:16:
In file included from /Users/MNurdin/Documents/Game/WTP/frameworks/js-bindings/bindings/proj.ios_mac/../../cocos2d-x/extensions/assets-manager/AssetsManager.h:32:
/Users/MNurdin/Documents/Game/WTP/frameworks/js-bindings/bindings/proj.ios_mac/../../cocos2d-x/extensions/assets-manager/Manifest.h:36:10: fatal error: 'json/document.h' file not found
#include "json/document.h"

I follow exactly this tutorial from A- Z. I run this command in my terminal to compile my project.

cocos compile -p ios

Reference: http://cocos2d-x.org/docs/manual/framework/html5/v2/cocos-console/en


Solution

  • This is only an issue if you are using the source code from github. I assume you are missing extra step required when you got the project from github.

    In ReadMe it says:

    Github note

    If you fork our github repository or download the package from github, you will need to do some extra tasks:

    • Run frameworks/js-bindings/cocos2d-x/download-deps.py to download external dependencies for Cocos2d-x
    • Run tools/cocos2d-console/download-bin.py to download bin files for some cocos2d-console plugins like Google Closure Compiler and JSC Compiler.