Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - glombool

Pages: [1]
1
General / Buffer overflow with basic Window tutorial
« on: November 03, 2010, 06:36:04 am »
I'm using Visual Studio 2010 in Windows XP.  Using the dynamically linked lib files, I get a "buffer overrun" error when I run the program.

It happens here: sf::Window App(sf::VideoMode(800,600,32), "Sfml Window");

I did include sfml-main.lib.  Dependencies are listed in this order:
sfml-system.lib
sfml-window.lib
sfml-main.lib

The dll files are in the correct directory as well.

Any help would be appreciated.

Full source:
Code: [Select]

#include <SFML/Window.hpp>
using namespace sf;

int main()
{
Window App(VideoMode(800,600,32), "Sfml Window");

while(App.IsOpened())
{
Event Event;
while(App.GetEvent(Event))
{
if(Event.Type == Event::Closed)
App.Close();

if(Event.Type = Event::KeyPressed)
{
switch (Event.Key.Code)
{
case Key::Escape:
App.Close();
break;
}
}
}

App.Display();
}

return EXIT_SUCCESS;
}

Pages: [1]