[-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
可以解決編譯出錯問題, 如有更好方案, 請不吝賜教.