strange error.

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
Are you linking to the debug libraries?
im linking to these files:
1
2
3
4
sfml-system.lib
sfml-window.lib
sfml-system-d.lib//these are debug files
sfml-window-d.lib

maybe i should remove the first 2 ?
I guess try removing the release libs, and see if it works.
if i ramove the first 2 and built my program it doesn't give errors but when i open it it says :
the application was unable to start correctly (0xc0150002). click ok to close the application.
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?
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
Are you building in release or debug mode?
release but i have tried both and they both didn't work
found what i did wrong. i had to put my DLL's in the debug file next to my .exe file
Topic archived. No new replies allowed.