Stack Corruption Error

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.

Any help on why this error would appear?

Last edited on
Try
sf::Image image;
or
sf::Image image(1,1);
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).
Last edited on
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.
I was using them in VS Professional 2010.

I hadn't seen your post when I edited my previous post though.
I am sure The linking is proper as other things from the Libraries work good.

Well, anyways, I will see if I can find anything about it in the SFML site.
Thanks.
Topic archived. No new replies allowed.