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