SFML community forums

Help => Graphics => Topic started by: Paci4416 on June 03, 2009, 09:46:26 pm

Title: Buffer overflow when run tut code
Post by: Paci4416 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.
Title: Buffer overflow when run tut code
Post by: Laurent on June 03, 2009, 10:44:25 pm
You're probably mixing debug and release configurations.
Title: Buffer overflow when run tut code
Post by: Paci4416 on June 04, 2009, 12:30:09 am
How can i fix it?
Title: Buffer overflow when run tut code
Post by: Laurent 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.
Title: Buffer overflow when run tut code
Post by: Paci4416 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. :/
Title: Buffer overflow when run tut code
Post by: Laurent 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.
Title: Buffer overflow when run tut code
Post by: Paci4416 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!