Looks like -O1 helps me to. пятница, 5 августа 2016 г., 1:13:06 UTC+3 пользователь caiiiycuk написал: > > Hi. I trying to build cocos2d with emscripten. For now i can compile the > framework with emscripten, but linking is broken. If i run simple project > then error occured: > > missing function: _ZN7cocos2d6ObjectD2Ev > index.html:77 -1 > SimpleGame.js:322649 Uncaught abort(-1) at Error > at jsStackTrace > (file:///home/caiiicyuk/emscripten/cocos2dx-em/samples/Cpp/SimpleGame/proj.emscripten/bin/debug/SimpleGame.js:1168:13) > at stackTrace > (file:///home/caiiicyuk/emscripten/cocos2dx-em/samples/Cpp/SimpleGame/proj.emscripten/bin/debug/SimpleGame.js:1185:12) > at abort > (file:///home/caiiicyuk/emscripten/cocos2dx-em/samples/Cpp/SimpleGame/proj.emscripten/bin/debug/SimpleGame.js:322757:44) > at __ZN7cocos2d6ObjectD2Ev [cocos2d::Object::~Object()] > (file:///home/caiiicyuk/emscripten/cocos2dx-em/samples/Cpp/SimpleGame/proj.emscripten/bin/debug/SimpleGame.js:8627:67) > at __ZN7cocos2d5ImageD2Ev [cocos2d::Image::~Image()] > (file:///home/caiiicyuk/emscripten/cocos2dx-em/samples/Cpp/SimpleGame/proj.emscripten/bin/debug/SimpleGame.js:294992:2) > > But this function is defined in CCObject.o file. I have a small test case. > I trying to link 3 files with em++ including CCObject.o, but output has > undefined symbol ZN7cocos2d6ObjectD2Ev. > > OS: XUbuntu 16.04 > Emscripten: incoming > > > llvm-nm CCObject.o |grep _ZN7cocos2d6ObjectD2Ev > *-------- T _ZN7cocos2d6ObjectD2Ev* > > > llvm-nm CCAction.o |grep _ZN7cocos2d6ObjectD2Ev > U _ZN7cocos2d6ObjectD2Ev > > > llvm-nm CCActionManager.o |grep _ZN7cocos2d6ObjectD2Ev > U _ZN7cocos2d6ObjectD2Ev > > > em++ CCAction.o CCObject.o CCActionManager.o --shared -o lib.so > WARNING:root:Dynamic libraries (.so, .dylib, .dll) are currently not > supported by Emscripten. For build system emulation purposes, Emscripten > will now generate a static library file (.bc) with the suffix '.so'. For > best practices, please adapt your build system to directly generate a > static LLVM bitcode library by setting the output suffix to '.bc.') > > > llvm-nm lib.so |grep _ZN7cocos2d6ObjectD2Ev > * U _ZN7cocos2d6ObjectD2Ev* > -------- T _ZN7cocos2d6ObjectD2Ev.3 > > If i link only two files (CCAction + CCObject) or (CCObject + > CCActionManager) then output does not contains udefined symbol. > > You can download archive with *.o files from attachment. >
-- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
