android jni 出现format not a string literal and no format arguments [-Werror=format-security]问题

来源:互联网 发布:电视机网络顶盒 编辑:程序博客网 时间:2024/04/30 01:55

使用eclipse, 如果编译jni过程出现如下错误:
error: format not a string literal and no format arguments [-Werror=format-security]
解决方法:
这是由于android-ndk-r10e与eclipse的编译环境不够兼容,才出现的错误。
在你的ndk目录下修改build/core/default-build-commands.mk
TARGET_FORMAT_STRING_CFLAGS := -Wformat -Werror=format-security

TARGET_FORMAT_STRING_CFLAGS := -Wformat #-Werror=format-security
也就是把后面部分注释掉

也就是在编译的过程中不让这个报错而已。

0 0
原创粉丝点击