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

Author Topic: Buffer overflow with basic Window tutorial  (Read 3826 times)

0 Members and 1 Guest are viewing this topic.

glombool

  • Newbie
  • *
  • Posts: 4
    • View Profile
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;
}

inlinevoid

  • Newbie
  • *
  • Posts: 49
    • MSN Messenger - inlinevoidmain@gmail.com
    • AOL Instant Messenger - inlinevoid
    • View Profile
    • Email
Buffer overflow with basic Window tutorial
« Reply #1 on: November 03, 2010, 07:10:00 am »
This is just a guess but... If you're in debug mode, make sure you're linking to the debug libs.

They are the ones with the "-d" suffix.

For example...

sfml-system-d.lib
sfml-window-d.lib
sfml-main-d.lib (actually, I'm not sure about this one.  I don't think you even need sfml-main.lib)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Buffer overflow with basic Window tutorial
« Reply #2 on: November 03, 2010, 08:04:18 am »
I'm so tired of answering this question everyday. Why don't people just read the tutorial? :cry:
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Buffer overflow with basic Window tutorial
« Reply #3 on: November 03, 2010, 11:33:42 am »
Quote from: "Laurent"
I'm so tired of answering this question everyday. Why don't people just read the tutorial? :cry:


*pats Laurent on his back*
There there... just link to where you've already answered it or to the tutorial which would be http://www.sfml-dev.org/tutorials/1.6/start-vc.php

Read the text guys AND follow the steps. They are there for a reason ;)
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Buffer overflow with basic Window tutorial
« Reply #4 on: November 04, 2010, 12:16:13 am »
Quote from: "Laurent"
I'm so tired of answering this question everyday. Why don't people just read the tutorial? :cry:

A postit would work better!

glombool

  • Newbie
  • *
  • Posts: 4
    • View Profile
Buffer overflow with basic Window tutorial
« Reply #5 on: November 04, 2010, 03:00:05 am »
Quote from: "Laurent"
I'm so tired of answering this question everyday. Why don't people just read the tutorial? :cry:


Laurent... I did read the tutorial.  I had  no problem with that.  It isn't a console app I had trouble with.

But when I moved on to http://www.sfml-dev.org/tutorials/1.6/window-window.php (Opening a Window), that is where the problems began.

I'm not a complete noob.  I RTM.  I at least tried searching the forum and didn't see anything which helped.

So... if someone can lead me in the right direction, I would appreciate it.

Debug mode wasn't the issue.  I tried both debug and release.

glombool

  • Newbie
  • *
  • Posts: 4
    • View Profile
Buffer overflow with basic Window tutorial
« Reply #6 on: November 04, 2010, 04:04:59 am »
Alright, so perhaps the forum does have that a lot 0.o

Not sure why I didn't see all those posts before.

I compiled SFML from source in VC 2010 and it is working just fine now.

glombool

  • Newbie
  • *
  • Posts: 4
    • View Profile
Buffer overflow with basic Window tutorial
« Reply #7 on: November 04, 2010, 06:09:48 am »
Quote from: "inlinevoid"
(actually, I'm not sure about this one.  I don't think you even need sfml-main.lib)


Actually, yes, I do.  I don't want to mess with WinMain.  Keep things portable  :D

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Buffer overflow with basic Window tutorial
« Reply #8 on: November 04, 2010, 07:59:20 am »
Quote
I compiled SFML from source in VC 2010 and it is working just fine now.

I missed this one, sorry. Indeed, VC 2008 libraries are not compatible with VC 2010. So ok, it's not in the tutorial but there are like 1 million posts about this on the forum ;)
Laurent Gomila - SFML developer