SFML doesn't come in different flavors for different compilers, so "SFML 2.1 for Visual Studio 2012" doesn't make much sense to me.
Did you compile SFML yourself or are you using a pre-built library?
There is nothing in this code that would cause the problem you indicate (whether or not the file was successfully read,) so one assumes the problem is somewhere in the toolchain (and history has shown that to often be the case.)
Yes, those are pre-built libraries. I had forgotten Laurent was officially supplying them, now. (For a long time they were not supplied while v2 was in development.) They aren't different flavors of SFML, though, they are all compiled from the same source.
I usually just pull the source from the github repository and compile for myself.
Assuming you've downloaded the correct version of the pre-built library as you say you have, you should again check to see if you're compiling with the debug libraries in release mode or vice versa.
From the instructions you linked to:
It is important to link to the libraries that match the configuration: "sfml-xxx-d.lib" for Debug, and "sfml-xxx.lib" for Release. A bad mix may result in crashes.