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

Author Topic: Buffer overflow when run tut code  (Read 2937 times)

0 Members and 3 Guests are viewing this topic.

Paci4416

  • Newbie
  • *
  • Posts: 6
    • View Profile
Buffer overflow when run tut code
« on: June 03, 2009, 09:46:26 pm »
Hello,

When i try to run the code on the tutorial about: Graphics - Drawing simple shapes

I get buffer overflow error on the first line of Draw.

        App.Draw(sf::Shape::Line(10, 10, 710, 100, 15, sf::Color::Red));

Using Console project and included the graphics-s.lib


Thank you in advance.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Buffer overflow when run tut code
« Reply #1 on: June 03, 2009, 10:44:25 pm »
You're probably mixing debug and release configurations.
Laurent Gomila - SFML developer

Paci4416

  • Newbie
  • *
  • Posts: 6
    • View Profile
Buffer overflow when run tut code
« Reply #2 on: June 04, 2009, 12:30:09 am »
How can i fix it?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Buffer overflow when run tut code
« Reply #3 on: June 04, 2009, 08:20:12 am »
Don't mix :D

I mean, if you compile in debug mode then link to the debug libraries of SFML ("-d" suffix). And vice-versa.
Laurent Gomila - SFML developer

Paci4416

  • Newbie
  • *
  • Posts: 6
    • View Profile
Buffer overflow when run tut code
« Reply #4 on: June 04, 2009, 10:11:39 am »
Ok, done.

now i get 5 errors in this concept:

 error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)

and in all the other colors in the tutorial.

I think it's means i need another a lib but which. :/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Buffer overflow when run tut code
« Reply #5 on: June 04, 2009, 10:18:40 am »
You need to add SFML_DYNAMIC to the preprocessor options, if you're using the dynamic libraries. It is explained in the "getting started" tutorial.
Laurent Gomila - SFML developer

Paci4416

  • Newbie
  • *
  • Posts: 6
    • View Profile
Buffer overflow when run tut code
« Reply #6 on: June 04, 2009, 11:02:07 am »
I skipped this part of the tut because I decided to use the static lib. :P

But now it's works :)

Thank you for the help!