I can compile this code fine in Codeblocks with Mingw. I don't get any compile errors. I'm pretty sure I have all of my settings fine. However when I run it instead of opening a window it just says the exe has stopped working.
It can get a lot more involved than that from my experience with SFML.
What Code::Blocks version are you using?
What SFML version are you using?
And most importantly what compiler and which version?
If your compiler is GCC 4.7.1, you need to recompile SFML for yourself, because it won't work otherwise
I'm using 12.11, I think it might be GCC, I'm not sure how to check which version of GCC I have -_-. I'm considering just using openGL, I've heard that it works great for 2d also.
I've compiled SFML to work with VC2010 now. I'm not going to work with SDL until I've become half way decent with C. I know, I know, you don't have to know C to use it. It's just a personal preference of mine since SDL is more C like, and SFML more c++ like. SDL is lower level and I think it will be important to learn it eventually.