SFML community forums

Help => General => Topic started by: timo777 on December 22, 2012, 12:38:07 pm

Title: Run-Time Check Failure #2
Post by: timo777 on December 22, 2012, 12:38:07 pm
I am using Windows 64 bit and SFML 2.0. Now, if I close the window on the normal way, i get the following error:

Run-Time Check Failure #2 - Stack around the variable 'window' was corrupted.

And randomly sometimes not that one but:

Run-Time Check Failure #2 - Stack around the variable 'shape' was corrupted.

I am trying to compile just the standard 'setting up' tutorial code so this shouldn't be a problem. I don't think I have used any release things. After commenting a bit the error doesn't appear without:

sf::CircleShape shape;

Does anyone know the answer?

Edit: so the error occurs at the end of the main() function but is somehow caused by that single line...
Title: Re: Run-Time Check Failure #2
Post by: binary1248 on December 22, 2012, 12:50:24 pm
You might want to read these:
http://en.sfml-dev.org/forums/index.php?topic=5559.msg36367#msg36367
http://en.sfml-dev.org/forums/index.php?topic=5559.msg36368#msg36368
Title: Re: Run-Time Check Failure #2
Post by: timo777 on December 22, 2012, 01:47:09 pm
Sorry, but I am new here.

I have an AMD Radeon graphics card, I don't know the exact number. I am using the static version of SFML. If the line of code given is not enough, look at the tutorial code. I only changed the constructor call of that line, not more. This is the call stack:

   Client.exe!main() Line 24   C++                                                             //Line 24 is end of main() function.
    Client.exe!__tmainCRTStartup() Line 536   C
    Client.exe!mainCRTStartup() Line 377   C
    kernel32.dll!749833aa()   Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]   
    ntdll.dll!77249ef2()   Unknown
    ntdll.dll!77249ec5()   Unknown

I am using the normal 2.0 RC version of SFML.
Title: Re: Run-Time Check Failure #2
Post by: Nexus on December 22, 2012, 02:00:38 pm
Please use the forum search. This has been answered dozens of times.

http://en.sfml-dev.org/forums/index.php?topic=7885
http://en.sfml-dev.org/forums/index.php?topic=9738
http://en.sfml-dev.org/forums/index.php?topic=7919
http://en.sfml-dev.org/forums/index.php?topic=2725
...
Title: Re: Run-Time Check Failure #2
Post by: timo777 on December 22, 2012, 02:05:32 pm
The point is I get this error when the window closes and I didn't mix up release and debug libraries. I will proberly compile SFML but it shouldn't be needed. I know I had it working some time ago on the same computer and things.

And I tought Google would display all posts... :)
Title: Re: Run-Time Check Failure #2
Post by: Laurent on December 22, 2012, 06:27:20 pm
What's your compiler, and which version of SFML 2 do you use?
Title: Re: Run-Time Check Failure #2
Post by: timo777 on December 22, 2012, 08:22:37 pm
I use the default MS Visual Studio 2012 compiler. And I don't know what exact version of SFML 2.0 I am using but I also tried the latest nightly build now.

Edit: I will just try to not use the sf::Shape class and hopefully there wouldn't go anything else wrong... :)
Title: Re: Run-Time Check Failure #2
Post by: Laurent on December 22, 2012, 08:51:11 pm
You should try to compile SFML yourself.

Quote
I will just try to not use the sf::Shape class and hopefully there wouldn't go anything else wrong...
I don't think do. There's no known bug with this class (especially the "getting started" code), so you're likely to get more errors. I really think it's an environment problem.
Title: Re: Run-Time Check Failure #2
Post by: timo777 on December 22, 2012, 11:50:07 pm
Until now everything works fine, including networking examples.