cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案


                    [-Werror=format-security] BUG FIX SOLUTION

场景: cocos2dx 跨平台开发, 移植Android版本时, 当进行到build_native.sh步骤后

ndk版本: android-ndk-r9

开发环境: mac os 64bit, Android+Eclipse

BUG:

  CCCommon.cpp:54:77: error: format not a string literal and no format arguments [-Werror=format-security]

原因:

  android-ndk-r9与Eclipse的版本不兼容问题

方案之一(我搜到的):

  在对应项目的proj.android/jni/Application.mk添加一句话

  APP_CFLAGS += -Wno-error=format-security

  意思就是无视这个error

可以解决编译出错问题, 如有更好方案, 请不吝赐教.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM