There are several things wrong or not that appreciated with your code/setup.
Upfront I highly suggest to use SFML 2, since SFML 1.6 has many problems which will never get fixed (one might even cause your problem) and SFML 2 is already out as RC which means it will soon be the offical release.
Have taken a closer look at the example given in the documentation?
Also I really recommend to read the tutorial on VS setup fully!
IMHO it's not good to use the namespace sf although there might never be any collisions but it's really hard to tell which functions/classes come from where.
When you're finished with the tutorial you'll notice that you never need #pragma comment (lib, "sfml-xyz.lib") instead you set it up with the project. This has specially the advantage whenever you'd want to port it to another platform you only have to setup a new project/makefile and not change the codebase.
Now for your problem, at first sight I'd say it's the nasty ATI bug of SFML 1.6. Do you have an ATI graphics card?
If you look at the example you'll notice that sf::Window has a IsOpened() function, which makes your bool running obsolent (except if you're doing some other stuff which I don't see atm).
Next you should also close the window after the close event was propageted. Although it probably gets called automatically in the destructor.
I guess the missing '.lib' is a typo, right?
#pragma comment (lib, "sfml-main.lib")
But you'll have to change the project settings to compile as 'window' and not as 'console'.
As a side note, this board has highlighting functionalities for code (dropdown box top left).
I have nvidia, not ATI
missing lib is not a typo, I deleted it because I thought that this is causing problem, and no I didn't take a close look at documentation example since I was taking examples from tutorial section (displaying window and handling events)
also I've setup everything right, Ieven have preprocessor (don't know if it is needed in my case but I did it, also tried it without it - same result), and including lib via #pragma is just same as doing it in properties, just faster and more flexible for me (I'm not going to recompile it to another platforms)
namespace sf - I'm using only sfml libs so far and they have only SF, so everything comes from sfml
I've changed my loop to MainWindow.IsOpened() and it's causing same error over and over again
so basically I've changed it to this:
#include <SFML/Window.hpp>
using namespace sf;
#pragma comment (lib, "sfml-window.lib")
#pragma comment (lib, "sfml-main.lib")
int main()
{
Window MainWindow(VideoMode::GetMode(0), "SFMLTest");
while(MainWindow.IsOpened())
{
Event Event;
while(MainWindow.GetEvent(Event))
{
if(Event.Type == Event::Closed)
MainWindow.Close();
if((Event.Type == Event::KeyPressed) && (Event.Key.Code == Key::Escape))
MainWindow.Close();
}
MainWindow.Display();
}
return 0;
}
and there is not any difference, it still has weird characters in title name instead of normal name and it's causing that error when closing
and I forgot that main, well, I don't have any settings for a console application in VS, there isn't such settings, I've created EMPTY project, which I'm using for both, win32 and console applications and it's working fine, main - console, WinMain - win32
also I have no idea what highlight function you mean, I don't see anything here O_o
EDIT:
I've downloaded and compiled SFML 2, and I'm getting those errors when compiling:
1> source.cpp
1>source.cpp(12): error C2039: 'IsOpened' : is not a member of 'sf::Window'
1> C:\Users\PCCCPCPCPC\Desktop\SFML-2.0\include\SFML/Window/Window.hpp(57) : see declaration of 'sf::Window'
1>source.cpp(12): fatal error C1903: unable to recover from previous error(s); stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
downloaded it from git, generated with cmake, compiled libs with 8 successfull and 0 failed, copied libs and includes to SFML-2.0 folder ondesktop (SFML-2.0/libs & /include), changed path in settings