1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
1>I:\xzbobzx\Bobstudios\Projects\Western Game\WesternGame\Release\WesternGame.exe : fatal error LNK1120: 1 unresolved externals
If you chose to create a "Windows application" project, then the entry point of your code has to be the "WinMain" function instead of "main". Since it's Windows specific, and your code would therefore not compile on Linux or Mac OS X, SFML provides a way to keep a standard "main" entry point in this case: link your project to the sfml-main module ("sfml-main-d.lib" in Debug, "sfml-main.lib" in Release), the same way you linked sfml-graphics, sfml-window and sfml-system.
You didn't read the tutorial, ok... But you could have at least read the 3 lines that zsbzsb kindly quoted for you. :/
Leave your debug config as is if you want the console, and link "sfml-main.lib" in release.
Either way, I read the tutorial again, and I followed your advice, tried it, but the console window still wouldn't budge. My project is a Console Application, not a Windows Application, so in the end WinMain isn't even of importance.
I don't understand why the console window went away so easily in vc2010 and not in vc2012 even though both projects were console applications. :\
I'm guessing you still may have not fully understood what others have suggested here, but there is another solution for your problem that might be easier to grasp. Simply put this following code at the start of your program while keeping your subsystem as console:
This is far from the best solution, as it only works in Visual Studio and the console window will still appear for a second or so, but it might be enough for your purposes. =)
Either way, I read the tutorial again, and I followed your advice, tried it, but the console window still wouldn't budge. My project is a Console Application, not a Windows Application, so in the end WinMain isn't even of importance.
I don't understand why the console window went away so easily in vc2010 and not in vc2012 even though both projects were console applications. :\
If you choose console as your application type you will always get the console window. This is no different for VS 2010 - so you must not be remembering that you had it set to window application to hide the console.
Then, how did I have a console window in my Debug Version while I didn't have one in the release version?Project settings > Linker > System > Sub-system. You had it to "Console" in Debug and "Windows" in Release.
QuoteThen, how did I have a console window in my Debug Version while I didn't have one in the release version?Project settings > Linker > System > Sub-system. You had it to "Console" in Debug and "Windows" in Release.
1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
1>I:\xzbobzx\Bobstudios\Projects\Western Game\WesternGame\Release\WesternGame.exe : fatal error LNK1120: 1 unresolved externals
There's no difference, really. Except in your code: when you choose "Windows" your entry point must be WinMain instead of main. If you don't want to define it, and keep a portable code, you can link to sfml-main instead.