Android NDK assert.h problems

848 views
Skip to first unread message

Aristarh Smertin

unread,
Feb 4, 2012, 5:44:13 AM2/4/12
to android-ndk
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.

If there is some android specific one assert.h? it's totally useless
if app just crash without assert message.

Or i just do something wrong?

Mārtiņš Možeiko

unread,
Feb 4, 2012, 3:05:45 PM2/4/12
to andro...@googlegroups.com
Hi.

If you want to compile your code with asserts then you can do it in three ways:
* use NDK_DEBUG=1 argument in ndk-build commandline
* add android:debuggable="true" to tag <application> in AndroidManifest.xml
* add APP_OPTIM := debug to your Application.mk file - this will also
disable optimizations and will compile with debug symbols

--
Mārtiņš Možeiko

> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

Aristarh Smertin

unread,
Feb 5, 2012, 3:15:55 AM2/5/12
to android-ndk
Thank you so much
Reply all
Reply to author
Forward
0 new messages