c++ - If my code uses RTTI then it will not work on android? -


i read in android native development kit cookbook that:

by default, android provides minimal c++ support. there's no run-time type information (rtti) , c++ exceptions support, , c++ standard library support, partial. following list of c++ headers supported android ndk default:

cassert, cctype,cerrno, cfloat, climits, cmath, csetjmp, csignal, cstddef, cstdint, cstdio, cstdlib, cstring, ctime, cwchar, new, stl_pair.h, typeinfo, utility

it possible add more c++ support using different c++ libraries. ndk comes gabi++, stlport, , gnustl c++ libraries, besides system default one. in our sample code, used external "c" wrap c++ method. avoid c++ mangling of jni function names. c++ name mangling change function names include type information parameters, whether function virtual or not, , on. while enables c++ link overloaded functions, breaks jni function discovery mechanism.

we can use explicit function registration method covered in loading native libraries , registering native methods recipe of chapter 2, java native interface, rid of wrapping.

if rtti used in logic of application not work on android?

you can turn on, off default. turn on, add local_cppflags += -frtti makefile. usual, code flag on take more memory, bigger on disk, , slower code off.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -