Advertisement Jump to content
Sign in to follow this  
ynkm169

How to debug runtime error - vector subscript out of range?

This topic is 4091 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: When I encounter such an error(vector subscript out of range), the error message only mentions where in the VisualStudio/include/vector file that the error comes from. However, this is not helpful for debugging purpose at all. Is there anyway to trace where in, say.. a million places where i have vector subscript, that the error is generated? I use Visual Studio 2005. Thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement
Just look further down in the call stack, to find out where the vector function was called from.

Share this post


Link to post
Share on other sites
Run it in your debugger and run up the call stack when the error occurs.

That and learn to love asserts and try/catch blocks.

Edit: Sneftel stole my thunder.

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!