在cocos creator上編譯安卓App的時候,在21 level下沒問題,但19 level下回報以下錯誤:android
- xxx/proj.android/../cocos2d/cocos/./platform/CCFileUtils.cpp:277: error: undefined reference to 'atof'
- xxx/proj.android/../cocos2d/cocos/./platform/CCFileUtils.cpp:286: error: undefined reference to 'atof'
- xxx/proj.android/../cocos2d/cocos/./base/CCConsole.cpp:1224: error: undefined reference to 'srand'
- xxx/proj.android/../cocos2d/cocos/./base/CCConsole.cpp:1225: error: undefined reference to 'rand'
- xxx/proj.android/../cocos2d/cocos/./base/CCConsole.cpp:1253: error: undefined reference to 'srand'
- xxx/proj.android/../cocos2d/cocos/./base/CCConsole.cpp:1254: error: undefined reference to 'rand'
- xxx/proj.android/../cocos2d/cocos/./base/ccUtils.cpp:254: error: undefined reference to 'atof'
- xxx/proj.android/../cocos2d/cocos/./base/ccRandom.h:117: error: undefined reference to 'rand'
- xxx/Pickle/proj.android/../cocos2d/cocos/./base/ccRandom.h:117: error: undefined reference to 'rand'
- xxx/proj.android/../cocos2d/cocos/./2d/CCActionTiledGrid.cpp:280: error: undefined reference to 'srand'
- xxx/proj.android/../cocos2d/cocos/./2d/CCActionTiledGrid.cpp:605: error: undefined reference to 'srand'
解決辦法:dom
修改proj.android/jni/Application.mk文件,增長以下一行代碼:spa
APP_PLATFORM := android-19orm
再從新編譯就ok了,這樣不論是編譯x86的,仍是arm得,仍是armv7的就都不報錯了。io