Jun 28, 2012 at 3:15pm UTC
hello i'm learning SFML library and i picked a code from the tutorial. it opens a window and it should make me able to close it again but when i close it it says
Debug Error!
Run-Time Check Failure #2 - stack around variable 'App' was corrupted.
and then the console stops working.
this is my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
int main()
{
// Create the main window
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Events" );
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key : exit
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}
// Display window on screen
App.Display();
}
return EXIT_SUCCESS;// = return 0
}
could someone please tell me what i could do to prevent this from happening or how this comes.
Last edited on Jun 28, 2012 at 3:16pm UTC
Jun 28, 2012 at 3:37pm UTC
Are you linking to the debug libraries?
Jun 28, 2012 at 4:04pm UTC
I guess try removing the release libs, and see if it works.
Jun 28, 2012 at 4:15pm UTC
If you're running the debug build, you should only need the -d libs. Looks like it's a DLL issue. Are you using 64 bit DLLs on a 32 bit machine?
Jun 28, 2012 at 4:19pm UTC
i have a 64 bit computer. and in microsoft vc++ 2010 i can do build solution or debug and i always do build solution.
Last edited on Jun 28, 2012 at 4:21pm UTC
Jun 28, 2012 at 4:25pm UTC
Are you building in release or debug mode?
Jun 28, 2012 at 4:30pm UTC
release but i have tried both and they both didn't work
Jun 28, 2012 at 5:05pm UTC
found what i did wrong. i had to put my DLL's in the debug file next to my .exe file