Reputation: 55
I have faced with problem when I try to build simple project from source using emscripten. Let me describe my acts step by step:
Next step I have tried to build for web using emscripten in directory of project i have entered in console:
cmake -DCMAKE_CXX_COMPILER=em++ -DCMAKE_CC_COMPILER=emcc
make
Firstly, I have got error with CC_DLL in tinyxml2.h, I removed CC_DLL, And rerun. Then I have got error on unknown include in directory "unzip" ( I have copied zlib.h and zconf.h to directory) and rerun. Then I have got error with GLubyte -use of undeclared identifier, I have added:
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
and rerun And Then I have got error use of undeclared identifier 'glDeleteBuffers'; in directory /cocos /2d/CCCameraBackgroundBrush.cpp and many same errors, and I do not know what to do...
Could You help me please how to fix it?
Thank you for any help!
Upvotes: 0
Views: 1020
Reputation: 1596
You can try to use emscripten-port of cocos2d. Just add -s USE_COCOS2D=3 to your build.
I maintain this port, and I already ported with it couple of cocos2dx games.
Now this port is merged only to incoming branch. Also, you can run cocos2d hello world project with this command:
python tests/runner.py browser.test_cocos2d_hello
Upvotes: 2