Android studio2.2 ndk 错误 :format not a string literal and no format arguments!
在Android Studio2.2 进行NDK编程,在对*char 字符串 进行日志输出时,报错:
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
也就是把后面部分用#号注释掉

在 在Application.mk里面添加下面代码
APP_CPPFLAGS += -Wno-error=format-security
加入之后确实ok了。编译通过了。
但是这个修改后,报运行错误 !
最后通过修改代码
把env->GetStringUTFChars(name_,0);
改成:
Env->GetStringUTFChars(name_NULL);
如下图:

运 行,通过!
Android studio2.2 ndk 错误 :format not a string literal and no format arguments!的更多相关文章
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
原文地址 : http://www.cnblogs.com/hhuang2012/p/3336911.html cocos2dx android版本移植时的Error format not a str ...
- 生成apk文件遇到的编译问题error: format not a string literal and no format arguments
编译错误时使用的android-ndk为r9的版本号.报下面错误: "Compile++ thumb : cocosdenshion_static <= SimpleAudioEngi ...
- format not a string literal and no format arguments
今天cocos2d-x打包 android的时候报错:format not a string literal and no format arguments 报错点是:__String::create ...
- Error format not a string literal and no format arguments解决方案
原地址: http://blog.csdn.net/joeblackzqq/article/details/25985299 cData.cpp:355:30:error:format not a s ...
- error: format not a string literal and no format arguments [-Werror=format-security]
You can put this in your Application.mk to disable treating those warnings as errors: APP_CFLAGS += ...
- android studio2.2 配置NDK
1.配置环境: Android studio2.2 配置NDK NDK版本[android-ndk-r13b-windows-x86_64.zip] NDK下载网址:[https://dl.googl ...
- 【Android Studio安装部署系列】二十五、Android studio使用NDK生成so文件和arr文件
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 Android Studio使用ndk的简单步骤. NDK环境搭建 下载NDK 下载链接:https://developer.and ...
- Android Studio2.1.2 Java8环境下引用Java Library编译出错
转载请注明出处:http://www.cnblogs.com/LT5505/p/5685242.html 问题:在Android Studio2.1.2+Java8的环境下,引用Java Librar ...
- Android Studio2.x版本无法自动关联源码的解决方法
Android Studio2.x版本无法自动关联源码的解决方法 在学习android开发过程中,对于一个不熟悉的类,阅读源码是一个很好的学习方式,使用andorid studio开发工具的SDK M ...
随机推荐
- Linux2.6内核进程调度系列--scheduler_tick()函数1.总体思想
参考的是ULK第三版,Linux2.6.11.12内核版本. 调度程序依靠几个函数来完成调度工作,其中最重要的第一个函数是scheduler_tick函数,主要步骤如下: /** * 维持当前最新的t ...
- Solr 4.0 部署实例教程
Solr 4.0 部署实例教程 Solr 4.0的入门基础教程,先说一点部署之后肯定会有人用solrj,solr 4.0好像添加了不少东西,其中CommonsHttpSolrServer这个类改名为H ...
- The file “base.app” couldn’t be opened because you don’t have permission to view it.
Base项目是在Xcode7上创建的,升级Xcode8以后,编译时候提示错误: The file "base.app" couldn't be opened because you ...
- Lucene 时间排序
在Lucene4.4中,想要实现搜索结果按照时间倒序的效果:如果两个文档得分相同,那么就按照发布时间倒序排列:否则就按照分数排列.这种效果在Lucene4.6中实现起来极其简单,直接利用search接 ...
- CGLib动态代理原理及实现
JDK实现动态代理需要实现类通过接口定义业务方法,对于没有接口的类,如何实现动态代理呢,这就需要CGLib了.CGLib采用了非常底层的字节码技术,其原理是通过字节码技术为一个类创建子类,并在子类中采 ...
- redis 集群配置实战
文章转载自:http://hot66hot.iteye.com/blog/2050676 最近研究Redis-cluster,正好搭建了一个环境,遇到了很多坑,系统的总结下,等到redis3 rele ...
- WIN 下的超动态菜单(三)代码
WIN 下的超动态菜单(一)简介 WIN 下的超动态菜单(二)用法 WIN 下的超动态菜单(三)代码 作者:黄山松,发表于博客园:http://www.cnblogs.com/tomview/ 超动态 ...
- C语言猜拳游戏
2016年最后一篇文章 今天闲来无事Google了一段C语言写的猜拳游戏的代码(本人水平比较低,几乎是刚入门),我没做什么修改.这个switch语句里面对result的处理让我眼前一新,原来是这么玩的 ...
- js快速判断IE浏览器(兼容IE10与IE11)
在很多时候,我们一般采用navigator.userAgent和正则表达来判断IE浏览器版本,下面介绍用IE浏览器中不同特性来判断IE浏览器 1 判断IE浏览器与非IE 浏览器 IE浏览器与非IE ...
- spring cron表达式
其他参考资料 http://www.blogjava.net/hao446tian/archive/2012/02/13/369872.html http://blog.sina.com.cn/s/b ...