Type cannot use 'try' with exceptions disabled
cannot use ‘throw’ with exceptions disabled
在为 DragonBonesCPP/refactoring 的 cocos2d-x-3.2 demo 增加 Android 编译时,NDK 报了一个编译错误:
error: cannot use ‘throw’ with exceptions disabled
throw std::invalid_argument(“Invalid data.”);
这是由于 DragonBonesCPP 库使用了 C++ 标准异常,而 Android NDK 编译器默认不支持 C++ 异常控制导致。
但是,从Android NDK r5 版本开始,NDK 就开始支持 C++ 异常控制了,我的版本是 r9d ,为什么还会出现这个错误呢?
原来,NDK 编译器的 C++ 异常控制特性支持默认是关闭的。要打开它,可以这样做:
编辑 Android.mk 文件,加入下面的代码:
LOCAL_CPP_FEATURES += exceptions
或者:
LOCAL_CPPFLAGS += -fexceptions
这样可以对当前项目开启 C++ 异常控制编译支持。
如果想偷懒,也可以编辑 Application.mk 文件,加入下面的代码:
APP_CPPFLAGS += -fexceptions
这样,所有模块的 C++ 异常控制编译支持都会被打开。
上面的两个 mk 文件位于 proj.android/jni
文件夹中。
转自 http://zengrong.net/post/2168.htm/comment-page-1
Type cannot use 'try' with exceptions disabled的更多相关文章
- cannot use 'throw' with exceptions disabled(转)
在为 DragonBonesCPP/refactoring 的 cocos2d-x-3.2 demo 增加 Android 编译时,NDK 报了一个编译错误: error: cannot use ‘t ...
- ios cannot use "@throw" with objective-c exceptions disabled 问题解决方案
http://blog.csdn.net/huayu_huayu/article/details/51781182 我不转载 我跳转 哈哈哈哈哈哈 其实也就是 解决办法:修改target -&g ...
- javascript 设置input框只读属性 获取disabled后的值并传给后台
input只读属性 有两种方式可以实现input的只读效果:disabled 和 readonly. 自然两种出来的效果都是只能读取不能编辑,可是两者有很大不同. Disabled说明该input ...
- 工作中碰到的js问题(disabled表单元素不能提交到服务器)
今天碰到一个奇葩的问题,asp页面表单提交后,有一个文本框<input type="text" name="phone" id="phone&q ...
- HTML中禁用表单控件的两种方法readonly与disabled
时候我们会希望表单上的控件是不可修改的,比如在修改密码的网页中,显示用户名的文本框就应该是不可修改状态的,下面与大家分享下禁用表中控件的两种方法 在网页的制作过程中,我们会经常使用到表单.但是有时候我 ...
- Readonly和disabled的区别 display:none和visible:hidden的区别
怎样使input中的内容为只读,也就是说不让用户更改里面的内容. <input type="text" name="input1" value=" ...
- 按钮/文本框 disabled
需求:已登入的,将用户的信息回填,用户文本框内容不能更改. 按钮: <button type="button" id="btnSearch">< ...
- 转:表单中Readonly和Disabled的区别(HTML中使用javascript解除禁止input输入框代)
转:表单中Readonly和Disabled的区别 参考资料: disabled和readonly区别: 参考博文1地址:http://blog.csdn.net/symgdwyh/article/d ...
- input属性disabled和readonly的区别
两种属性的写法如下: 1.<input type="text" name="name" value="xxx" disabled=&q ...
随机推荐
- cdev结构体
在内核源码include/linux/cdev.h里对cdev结构体的定义: struct cdev { struct kobject kobj; // 内嵌的kobject对象 struct mo ...
- 和为s的两个数字 和为s的连续正数序列
输入一个递增排序的数组和一个数字s,在数组中查找两个数,使得它们的和正好是s,如果有多对数字的和等于s,输出任意一对即可. #include <iostream> using namesp ...
- 二分查找与 bisect 模块
Python 的列表(list)内部实现是一个数组,也就是一个线性表.在列表中查找元素可以使用 list.index() 方法,其时间复杂度为O(n).对于大数据量,则可以用二分查找进行优化.二分查找 ...
- vscode and python
http://robotkang.cc/2017/04/VS-Code-%E9%85%8D%E7%BD%AEPython/
- spring配置datasource三种方式 数据库连接池
尊重原创(原文链接):http://blog.csdn.net/kunkun378263/article/details/8506355 1.使用org.springframework.jdbc.da ...
- Java-确定被加载类的路径
如何输出当前类在硬盘的物理路径 package com.tj; import java.net.URL; import java.security.CodeSource; import java.se ...
- python linux安装anaconda
步骤: 1.在清华大学镜像站中下载anaconda版本:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ https://mirrors.t ...
- 九度oj 题目1086:最小花费
题目描述: 在某条线路上有N个火车站,有三种距离的路程,L1,L2,L3,对应的价格为C1,C2,C3.其对应关系如下: 距离s 票价 0<S<=L1 ...
- Replication and Triggers
参考官网:https://dev.mysql.com/doc/refman/5.7/en/replication-features-triggers.html 需要了解复制和触发器关系的背景: 程序变 ...
- 转 CListCtrl::InsertColumn、InsertItem、SetItemText;
将数据写入到CListCtrl 向CListCtrl中写入数据,一般使用3个成员方法: CListCtrl::InsertColumn; CListCtrl::InsertItem; CListCtr ...