Buffer Overrun Issues

Hi there!

I get an error saying:" A buffer overrun has occurred in render window.exe which has corupted the program's internal state."

I am using the SFML library and Visual C++ Express 2010
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "stdafx.h"
#include <SFML/Graphics.hpp>

int main()
{
   sf::RenderWindow App(sf::VideoMode(800, 600, 32),"Render Window");
   while(App.IsOpened())
   {
      sf::Event Event;
      while(App.GetEvent(Event))
      {
         if(Event.Type == sf::Event::Closed)
         {
             App.Close()
         }
      }

      App.Clear();
      App.Display();
   }

 return EXIT_SUCCESS:
}



When I step, the error happens at App.Clear();
What is the reason for this and what is a Buffer Overrun Issue?

Thanks
FR3DDIE
It's been a while since I used sfml, but if I recall correctly, this happens when you link to sfml-<something>.lib instead of sfml-<something>-d.lib
So I shouldn't link to both? If I link only with the sfml-graphics-d.lib I get an error saying that the program failed to start correctly
I thought you should only link to sfml-<something>.lib and not the debug?
closed account (S6k9GNh0)
The linker should give you an error if you link to both give the conflicting functions. No, you should not link to the two libraries.

You should link to the debug library... if you're wanting to debug. It provides debugging facilities, strict checking, etc. (as do most libraries in a debug mode).
Last edited on
Like I said, if I only link to the following libs:
Sfml-system-d.lib
Sfml-window-d.lib
Sfml-graphics-d.lib
Sfml-main.lib


Then I get an error saying that the program failed to start correctly?
Why didn't you link to sfml-main-d.lib?
I only use sfml-main.lib when using win32 apps, while avoiding winmain :) hardly reckon its nescesary to add sml-main-d.lib?
Topic archived. No new replies allowed.