Home > use typeid > error cannot use typeid

Error Cannot Use Typeid

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies cannot use typeid with -fno-rtti of this site About Us Learn more about Stack Overflow the company how to use typeid in c++ Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges

Gcc_enable_cpp_rtti

Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a

Enable Rtti

minute: Sign up Error: Cannot use typeid with -fno-rtti up vote 6 down vote favorite I´m getting this "Cannot use typeid with -fno-rtti" when I´m trying to compile my project, I´m using an opencv framework. I googled the problem but, it seems the errors I found in internet does not have relation with my problem. I don´t know if the problem is cmake enable rtti related with the includes, the code or the compiler. Xcode is giving me the error a lot of times, but the first error is here: virtual const std::type_info& type() { return typeid(T); } c++ objective-c xcode gcc compilation share|improve this question asked Jan 4 '12 at 8:00 Gustavo 393422 for Android NDK: cppFlags += "-frtti" –Anton Savenok Aug 25 '15 at 3:50 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted It's telling you the error right in the message: if you use the no-rtti flag on the compiler, then typeid is not going to be available. Just enable RTTI; it's part of C++ after all. share|improve this answer answered Jan 4 '12 at 8:04 GManNickG 231k29346470 1 I solved this checking "GCC_ENABLE_CPP_RTTI = YES", thank you!!! –Gustavo Jan 4 '12 at 8:18 add a comment| up vote 2 down vote RTTI stands for Run Time Type Information, and typeid is an RTTI-feature. So turning off RTTI (-fno-rtti) also disables features like typeid. See http://en.wikipedia.org/wiki/RTTI for more information about RTTI in C++. share|improve this answer

here

Gcc Fno-rtti

for a quick overview of the site Help fno-exceptions Center Detailed answers to any questions you might have Meta Discuss the gcc enable rtti workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about http://stackoverflow.com/questions/8723702/error-cannot-use-typeid-with-fno-rtti hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. http://stackoverflow.com/questions/30887826/native-code-cannot-use-typeid-with-fno-rtti Join them; it only takes a minute: Sign up Native Code: cannot use typeid with -fno-rtti up vote 0 down vote favorite I'm trying to build native code on android because I want to use VTK for my android tablet. However, I am facing some issues when it comes to building one of the vtk examples. I know this problem has been covered here for an objective c issue but I guess it is different for me. I get, from ndk-build: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in /Users/lonnibesancon/Documents/workspace/TestNativecopy/AndroidManifest.xml [armeabi-v7a] Compile++ thumb: ndk1 <= native.cxx In file included from /Users/lonnibesancon/Desktop/VTK/build4/CMakeExternals/Install/vtk-android/include/vtk-6.3/vtkTypedDataArray.h:34:0, from /Users/lonnibesancon/Desktop/VTK/build4/CMakeExternals/Install/vtk-android/include/vtk-6.3/vtkDataArrayTemplate.h:25, from /Users/lonnibesancon/Desktop/VTK/build4/CMakeExternals/Install/vtk-android/include/vtk-6.3/vtkIntArray.h:35, from /Users/lonnibesancon/Desktop/VTK/build4/CMakeExternals/Install/vtk-android/include/vtk-6.3/vtkCellTypes.h:39, from /Users/lonnibesancon/Desktop/VTK/build4/CMakeExternals/Install/vtk-android/include/vtk-6.3/vtkPolyData.h:60, from /Users/lonnibesancon/Desktop/VTK/build4/CMakeExternals/Install/vtk-android/include/vtk-6.3/vtkPolyDataAlgorithm.h:33, from /Users/lonnibesancon/Desktop/

download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript). Home Qt Development General and Desktop Cannot use typeid with -fno-rtti [SOLVED] Cannot use typeid with -fno-rtti [SOLVED] https://forum.qt.io/topic/20853/cannot-use-typeid-with-fno-rtti-solved This topic has been deleted. Only users with topic management privileges can see it. Seraph last edited by Hi folks, I'm using mingw4.0.4 with QT4.8.3 and Creator 2.5.2. I just want to compile the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160 following simple line of code in a default hello world console program: @cout< Reply Quote 0 Seraph last edited by [quote author="broadpeak" date="1351161772"]I only include this, and works: #include [/quote] With MinGW under Windows? Im working on the same projects under Ubuntu using gcc with no problem, too. Reply Quote 0 broadpeak last edited by I used it under Windows but with MinGW. (QtSDK 1.2.1) Reply Quote 0 Seraph last edited by [quote author="broadpeak" date="1351167587"]I used it under Windows but with MinGW. (QtSDK 1.2.1)[/quote] Hmm.

due to spam. Bug40160 - -fno-rtti vs _GLIBCXX_DEBUG Summary: -fno-rtti vs _GLIBCXX_DEBUG Status: RESOLVED FIXED Alias: None Product: gcc Classification: Unclassified Component: libstdc++ (show other bugs) Version: 4.3.2 Importance: P3 normal Target Milestone: 4.5.0 Assignee: Paolo Carlini URL: Keywords: Depends on: Blocks: Reported: 2009-05-15 14:02 UTC by Jay Foad Modified: 2009-05-18 09:46 UTC (History) CC List: 2 users (show) asl gcc-bugs See Also: Host: Target: Build: Known to work: Known to fail: Last reconfirmed: 2009-05-15 19:34:10 Attachments Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description Jay Foad 2009-05-15 14:02:50 UTC I get: $ cat s.cpp #include $ g++ -c -fno-rtti -D_GLIBCXX_DEBUG s.cpp In file included from /usr/include/c++/4.3/debug/debug.h:155, from /usr/include/c++/4.3/bits/stl_algobase.h:76, from /usr/include/c++/4.3/bits/char_traits.h:46, from /usr/include/c++/4.3/string:47, from s.cpp:1: /usr/include/c++/4.3/debug/formatter.h: In constructor ‘__gnu_debug::_Error_formatter::_Parameter::_Parameter(const __gnu_debug::_Safe_iterator<_Iterator, _Sequence>&, const char*, __gnu_debug::_Error_formatter::_Is_iterator)’: /usr/include/c++/4.3/debug/formatter.h:218: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h:224: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h: In constructor ‘__gnu_debug::_Error_formatter::_Parameter::_Parameter(const _Type*&, const char*, __gnu_debug::_Error_formatter::_Is_iterator)’: /usr/include/c++/4.3/debug/formatter.h:247: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h: In constructor ‘__gnu_debug::_Error_formatter::_Parameter::_Parameter(_Type*&, c

 

Related content

error cannot use typeid with

Error Cannot Use Typeid With table id toc tbody tr td div id toctitle Contents div ul li a href Cannot Use Typeid With -fno-rtti a li li a href Gcc Fno-rtti a li li a href Enable Rtti a li li a href Fno-exceptions a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any relatedl questions you might have Meta Discuss the workings and p h id Cannot Use Typeid With -fno-rtti p policies of this site About Us Learn more about Stack Overflow the how to