format not a string literal and no format arguments [-Werror=format-security]

問題:

   在使用ndk-r9版本的ndk-build命令編譯jni時,報錯error: format not a string literal and no format arguments [-Werror=format-security]


原因: Android-ndk-r9與Eclipse的版本不兼容問題。


解決方案:

在對應項目的jni/Application.mk添加一句話

  APP_CFLAGS += -Wno-error=format-security

意思就是忽視這個error

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章