你好我在Ubuntu 12.04上使用cocos2dx时使用终端获取来编译cocos2dx样本
/home/shiro/cocos2dx/cocos2d-x-2.1.4/cocos2dx/platform/android/CCCommon.cpp: In function 'void cocos2d::CCLog(char const*, ...)':
/home/shiro/cocos2dx/cocos2d-x-2.1.4/cocos2dx/platform/android/CCCommon.cpp:44:72: error: format not a string literal and no format arguments [-Werror=format-security]
/home/shiro/cocos2dx/cocos2d-x-2.1.4/cocos2dx/platform/android/CCCommon.cpp: In function 'void cocos2d::CCLuaLog(char const*)':
/home/shiro/cocos2dx/cocos2d-x-2.1.4/cocos2dx/platform/android/CCCommon.cpp:54:77: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [obj/local/armeabi/objs/cocos2dx_static/platform/android/CCCommon.o] Error 1
make: Leaving directory `/home/shiro/cocos2dx/cocos2d-x-2.1.4/samples/Lua/TestLua/proj.android'
当我在eclipse上导入相同的android项目时,控制台显示
/home/shiro/android-ndk-r9/bash /home/shiro/cocos2dx/cocos2d-x-2.1.4/samples/Lua/TestLua /proj.android/build_native.sh all
Error: Cannot run program "/home/shiro/android-ndk-r9/bash": Unknown reason
**** Build Finished ****
如果有人知道如何解决这个问题,请帮助,谢谢。
答案 0 :(得分:1)
请参阅disable -Werror ini configure file并尝试在Android.mk中删除-Werror。 如果您无法在任何地方找到它,请尝试使用-Wno-error
覆盖它