Jump to content
  • Advertisement
rjhwinner03

Would it be acceptable if I programmed a game for XP, Vista, 7, and 8 to spare for Windows 10? Are these Windows versions still widely used today?

Recommended Posts

I am trying to program a RTS game, and the only barrier that is keeping me from completing it is an error that says

 

 

Debug Assertion Failed.

C:\Program files(x86)\microsoft visual studio 9.0\vc\include\vector

Line:251

Expression: Vector iterators incompatible.

For information on how your program can cause an assertion failure, see Visual C++ documentation on asserts.

 

I have tried to find the incompatible vectors, but it doesnt tell me where they are...

 

Share this post


Link to post
Share on other sites
Advertisement
  • Post your failing code, there are many different ways to get this sort of error and appropriate fixes vary.
  • You need to look for any place in your code where std::vector iterators are used. You should be able to exclude a large portion of those calls because they can only happen before or after the failure.

By the way, Visual Studio 9 is ancient. Can you use a contemporary compiler? Why do you care for Windows XP and Vista?

 

Share this post


Link to post
Share on other sites

making games for operating systems that no longer receive security upgrades isn't a gr8 idea.
XP at least is still widely used but typically at businesses, business that would look poorly on employees that played games on them.

Share this post


Link to post
Share on other sites
27 minutes ago, rjhwinner03 said:

I care about XP and Vista because they can run Visual Studio 2003, the compiler that I know the most.

To be blunt, it's been 15 years... get a new compiler. C++ has moved on significantly since 2003 and the Visual Studio compilers are much better now. 

You can get Visual Studio 2017 community edition for free, and it will be far more standards compliant.

As far as XP, Vista, etc goes, XP support ended 4 years ago, Vista support ended last year. 7 and 8 are technically still supported OSs, and 7 in particular is still quite popular in Asia and Africa. It's difficult to get hard numbers, but the Steam Hardware Survey is pretty representative. So XP accounts for less than 0.5% of users and Vista doesn't even register. 

Share this post


Link to post
Share on other sites
Posted (edited)

The error indicates that the iterators are incompatible. Perhaps you're trying to erase an element that is in one vector from a completely different vector, without realizing it?

Hard to say without code...

You should also be able to break in the debugger at the point of the assertion. Then you can look up the call stack to see where the issue is in your code.

Edited by Oberon_Command

Share this post


Link to post
Share on other sites
4 minutes ago, rjhwinner03 said:

The error brings me to stdthrow.cpp on the " ::_CrtDbgBreak();" function...

Yes, and what is farther up the callstack?

Share this post


Link to post
Share on other sites
Posted (edited)

What do you mean?

Actually, from the looks of things, it appears to be a particle system that is giving errors... I am making a RTS game and I have a magician that shoots projectiles... Those are fireballs which are just particles grouped together. Whenever the particles hit the ground and scatter, it gives me that error I was mentioning in the first post...

Did this help any?

Edited by rjhwinner03

Share this post


Link to post
Share on other sites
Posted (edited)

https://en.wikipedia.org/wiki/Call_stack

When you call a function, your program jumps to another place in the code. When a function completes, it needs to "return" to the place in the program where it was called from. To get back to the place in the code that called the function, it needs to store that information somewhere. You can think of that as a "stack" of function return addresses. Each time a function calls another one, another entry is put on the call stack.

When you're debugging a program, Visual Studio should have a tab somewhere that shows what functions are on that callstack. If I have a a program that calls a function called Foo, which calls a function called Frobnicate, which calls a function called YourMom, then if you put a breakpoint in YourMom, Visual Studio should show you something like this when the breakpoint is hit:

  • YourMom
  • Frobnicate
  • Foo
  • main

Note that the most recently called function is on the top, while the functions that called it are beneath it.

The idea of a call stack is really fundamental, so make sure you get this idea good and internalized. So fundamental, in fact, that if you didn't know what it was before, then I suggest this thread should have been put in the For Beginners section.

If you're having trouble with the actual tools, then I suggest heading to the GDNet Discord chat or some Visual Studio-specific resource.

Edited by Oberon_Command

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!