I had set up SFML today and begun doing though the documentation on the sfml-dev site.
I was trying out the Graphical Library.
Now here is my code:
1 2 3 4 5 6 7 8 9 10
#include <SFML\Graphics.hpp>
#include "Functions.h"
int main()
{
sf::Image image (0,0,0);
PressAnyKey();
return 0;
} //This is is where the Break points during the Runtime error.
When I run that program it starts, prints
???????????????.
And then gives an runtime error:
Run-Time Check Failure #2 - Stack around the variable 'image' was corrupted.
If I chose to break the program, it points to the ending brace of the Main Function.
Tried both of them.
The error remains.
I also tried making another project and the with another code (but using Image as well, teh difference from this one was that it wasn't making an array of pixels, but rather loaded an Image) but error persisted.
What does this error mean by the way?
EDIT:
Tried using Sprite instead of Image, and the error vanished (though I guess it that output is some other error).
It means some memory bug, such as writing to or reading from invalid memory, involved that object somehow. I thought it might have been that you were passing a null pointer as the third parameter to the constructor, but if that's not it, then I don't know.
Could it be that you're not properly linking to the library? SFML is a C++ library, so you shouldn't mix binaries built with one compiler with a different compiler (different versions of the same compiler are considered different compilers). For example, if you're using VC++ 2010, you should use libraries for VC++ 2010, not 2008.