Problem upgrading from ndk version r5b to r7b

447 views
Skip to first unread message

Discordia

unread,
Mar 6, 2012, 3:48:31 PM3/6/12
to andro...@googlegroups.com
Hey

I have been staying on 5b for a long time and thought it was time to upgrade, but when I try to compile I get the error:

error: cannot use typeid with -fno-rtti 

when I include STL classes (example: shard_ptr.hpp from the tr1 namespace).

The full log:
In file included from C:/Android/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/tr1/memory:60,
                 from jni/../../../include/system/Configure.h:138,
                 from jni/../../../include/app/android/Activity.h:9,
                 from jni/../../../src/app/android/Activity.cpp:1:
C:/Android/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/tr1/shared_ptr.h: In member function 'virtual void* std::tr1::_Sp_counted_base_impl<_Ptr, _Dele                                                                                                                           ter, _Lp>::_M_get_deleter(const std::type_info&)':
C:/Android/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/tr1/shared_ptr.h:79: error: cannot use typeid with -fno-rtti
C:/Android/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/tr1/shared_ptr.h: In function '_Del* std::tr1::get_deleter(const std::tr1::__shared_ptr<_Tp1, _                                                                                                                           Lp>&)':
C:/Android/android-ndk-r7b/sources/cxx-stl/gnu-libstdc++/include/tr1/shared_ptr.h:642: error: cannot use typeid with -fno-rtti
/cygdrive/c/Android/android-ndk-r7b/build/core/build-binary.mk:243: recipe for target `obj/local/armeabi/objs-debug/audrey/src/app/android/Activity.o' failed
make: *** [obj/local/armeabi/objs-debug/audrey/src/app/android/Activity.o] Error 1
BUILD FAILED
 

Regards,
/Robert

David Turner

unread,
Mar 7, 2012, 7:52:33 AM3/7/12
to andro...@googlegroups.com
This might be related to this entry in the NDK r7b Changelog:

- When your application uses the GNU libstdc++ runtime, the compiler will
  no longer forcibly enable exceptions and RTTI. This change results in smaller
  code. If you need these features, you need to do either one of these:

     1/ Enable exceptions and/or RTTI explicitely in your modules or
        Application.mk. (recommended)

     2/ Define APP_GNUSTL_FORCE_CPP_FEATURES to 'exceptions', 'rtti' or both
        in your Application.mk. See docs/APPLICATION-MK.html for more details.

Hope this helps

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/Axhmhez7eB8J.
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.

Futumsh

unread,
Mar 7, 2012, 10:12:56 AM3/7/12
to andro...@googlegroups.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42019

Fixed in 4.5, so until the compiler is upgraded, you either need to enable rtti or modify your headers to use shared_ptr.
Reply all
Reply to author
Forward
0 new messages