Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:07:33+00:00 2026-05-24T21:07:33+00:00

I recently started porting an application to Android using the NDK and I encountered

  • 0

I recently started porting an application to Android using the NDK and I encountered the following error:

boost/function/function_base.hpp:220: error: cannot use typeid with -fno-rtti.

Ordinarily, I wouldn’t think twice about that error, but the visual studio project file set /GR-, which disables RTTI and has no problem using boost::function.

My theory on this is that because typeid is evaulated by the compilier when the static type can be determined, that must be the case for every usage of boost::function in the application. Visual Studio must be attempting to determine the static type first while GCC immediately throws the error on typeid before attempting to evaluate it.

Does that sound right? If not, what is going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:07:34+00:00Added an answer on May 24, 2026 at 9:07 pm

    I’m not booted into my Windows partition, but it was just as simple to look this up in MSDN.

    As per this link on MSDN:

    If the expression is dereferencing a pointer, and that pointer’s value
    is zero, typeid throws a bad_typeid exception. If the pointer does not
    point to a valid object, a __non_rtti_object exception is thrown,
    indicating an attempt to analyze the RTTI that triggered a fault (like
    access violation), because the object is somehow invalid (bad pointer
    or the code wasn’t compiled with /GR).

    If the expression is neither a pointer nor a reference to a base class
    of the object, the result is a type_info reference representing the
    static type of the expression. The static type of an expression refers
    to the type of an expression as it is known at compile time…..

    In other words, if the expression’s type can’t be inferred at compile time, and no /GR, then you’re going to get an exception or compiler error. But the second paragraph kind of implies it can infer non-ambiguous types at compile time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently started a project, using Apple's Utility Application example project. In the example
I recently started using eclipse and an AVD emulator to develop android apps for
We recently started getting the following error message in TFS 2010 automatedd builds: C:\Builds\1\MyProject\MyProject
I recently started using android actionbars and contextual action bars (CAB). I have just
I recently started work on a personal coding project using C++ and KDevelop. Although
I recently started using Eclipse at work for my Java servlet projects. I've been
We recently started using maven for dependency management. Our team uses eclipse as it's
I recently started using scons to build several small cross-platform projects. One of these
I recently started using Git as my version control system for some Cocoa projects
I recently started using Linux as my primary OS. What are the tools that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.