Well your code looks like a console application, yet you're trying to link it as a GUI application. It expected winmain - that's in the linker message, but all you have is main.