game-dev

Open full view…

building for android undefined reference getPositionPercent

nanocore
Fri, 12 Jun 2015 21:30:13 GMT

I am trying to build an android version of my app on OSX. I have installed the android sdk and android ndk (9) from homebrew ( and updated ANDROID_SDK_ROOT and NDK_ROOT to point to these new SDK locations) and upgraded to 0.9.9 for rapidgame and did a prebuild. That build successfully (only the android looked like it built the cocos2d side went by to quickly to actually have recompiled anything). Also, did a remove lib and rapidgame init . in the main directory. My app compiles cleanly for iOS and OSX, and am on to android. Granted this is my first time compiling an android app, and searched the internet for most of the issues that I have come across. I saw the note in the issues log about including cocos_zlib_static so that problem is gone. I am down to the last one. The process is at the linking stage and it can't resolve getPositionPercent(). I went down the path of including cocos_ui_static which then wanted 10 more static libs before asking for cocos_ui_static again. So, I stopped there. My Android.mk linking flags and static lib definitions looks like: LOCAL_LDFLAGS := -Wl,--allow-multiple-definition LOCAL_WHOLE_STATIC_LIBRARIES := libcocos2dx-prebuilt LOCAL_WHOLE_STATIC_LIBRARIES += cocos_png_static cocos_jpeg_static cocos_tiff_static cocos_webp_static \ cocos_curl_static cocos_freetype2_static spidermonkey_static websockets_static cocos_chipmunk_static \ cocos_zlib_static and the linking output: ARCH=armeabi APP_CPPFLAGS=-frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char -DCOCOS2D_JAVASCRIPT -DCOCOS2D_DEBUG=1 make[1]: Entering directory `/Users/greggjensen/dev/RotatEm/Projects/android' [armeabi] SharedLibrary : libcocos2djs.so jni/../../../lib/cocos2d/x/lib/Debug-Android/armeabi/libcocos2dx-prebu ilt.a(CCNodeReader.o):CCNodeReader.cpp:function cocostudio::timeline::NodeReader::loadNode(rapidjson::GenericValue<rap idjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&): error: undefined reference to 'cocos2d::ui::Widget::getPositionPercent() const' jni/../../../lib/cocos2d/x/lib/Debug-Android/armeabi/libcocos2dx-prebu ilt.a(CCNodeReader.o):CCNodeReader.cpp:function cocostudio::timeline::NodeReader::loadNode(rapidjson::GenericValue<rap idjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&): error: undefined reference to 'cocos2d::ui::Widget::getPositionPercent() const' collect2: error: ld returned 1 exit status make[1]: *** [obj/local/armeabi/libcocos2djs.so] Error 1 Any thoughts?