error: format not a string literal and no format arguments

使用android studio, 如果編譯jni過程出現如下錯誤:
error: format not a string literal and no format arguments [-Werror=format-security]
解決方法:
在你的ndk目錄下修改build/core/default-build-commands.mk
TARGET_FORMAT_STRING_CFLAGS := -Wformat -Werror=format-security

TARGET_FORMAT_STRING_CFLAGS := -Wformat   #-Werror=format-security
也就是把後面部分註釋掉
發佈了52 篇原創文章 · 獲贊 7 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章