Android NDK assert.h 问题 [英] Android NDK assert.h problems
本文介绍了Android NDK assert.h 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
第一个 - 是 NDEBUG 以某种方式默认已经定义的,所以断言在你 #undef 之前不起作用.第二个 - 他们确实有效,但我没有收到 DDMS 的登录信息.
First one - is what NDEBUG somehow already defined by default, so asserts don't work until you #undef it. Second one - they do they work, but i receive no logging in DDMS.
如果有一些android特定的assert.h?
If there is some android specific one assert.h?
还是我做错了什么?
推荐答案
如果你想用断言编译你的代码,那么你可以通过三种方式来做到:
If you want to compile your code with asserts then you can do it in three ways:
- 在 ndk-build 命令行中使用 NDK_DEBUG=1 参数
- 将 android:debuggable="true" 添加到 <应用程序 > AndroidManifest.xml 中的标签
- 将 APP_OPTIM := debug 添加到您的 Application.mk 文件 - 这也将禁用优化并使用调试符号进行编译
这篇关于Android NDK assert.h 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文