Jump to content
  • Advertisement
Sign in to follow this  
whiterook6

VC++ Access Violation RTTI data -- rtti included in compile

This topic is 3075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys. I'm getting an exception from a dynamic_cast that says
"Access violation - No Rtti data"

The only solution I've found is to turn on RTTI, but the compile options clearly say that it is enabled. The only complication I can see is that I'm dynamic_casting the pointer from a boost::scoped_ptr.

Example:
---
struct MessageBody {
virtual ~MessageBody(){}
}

struct ServerJoinPermissionBody : public MessageBody {
// ...
}

// ...
boost::scoped_ptr<MessageBody> body;
body.reset(new ServerJoinPermissionBody());

// ...
ServerJoinPermissionBody *b=dynamic_cast<ServerJoinPermissionBody *>(body.get()); // Access Violation - No RTTI Data
---

Can anyone help me? This is how a dynamic cast is used, right? (cast one pointer to another?)

Share this post


Link to post
Share on other sites
Advertisement
Your code works just fine for me. Some possibilities: you may of enabled RTTI for debug but not release or vice versa. You may have enabled RTTI for only one source file or the entire project.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!