output:
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp: In function ’void cocos2d::CCLog(char const**, …)’:
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp:44:72: error: format not a string literal and no format arguments
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp: In function ’void cocos2d::CCLuaLog’:
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp:54:77: error: format not a string literal and no format arguments
cc1plus: some warnings being treated as errors
make:***** Error 1
*** Build Finished**
Try to replace __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", buf);
with __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buf);
Does it help?
the next errors that popped up are
/Users/……/Documents/cocos2dx/platform/android/CCFileUtilsAndroid.cpp: In member function ‘virtual unsigned char* cocos2d::CCFileUtilsAndroid::getFileData(char const**, char const**, long unsigned int*)’:
/Users/……/Documents/cocos2dx/platform/android/CCFileUtilsAndroid.cpp:156:9: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
ok, to fix the next errors that pop up, in your “proj.android/jni/Application.mk” file, add the line
APP_CFLAGS += ~~Wno-error=format-security
so in my file it looks like
APP_STL := gnustl_static
APP_CPPFLAGS :=~~frtti ~~DCOCOS2D_DEBUG=1
APP_CFLAGS +=~~Wno-error=format-security
Then run the build_native.sh and it should build completely. You will still see the security warnings but it won’t count them as errors.
According to other threads adressing this issue, this is a temporary problem that will hopefully be fixed by a future cocos2dx release