Is this a console program project or a Windows project? I’m asking because for a Win32 and similar project, the entry point is WinMain()
.
- Right-click the Project (not the Solution) on the left side.
- Then click Properties -> Configuration Properties -> Linker -> System
If it says Subsystem Windows
your entry point should be WinMain(), i.e.
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
{
your code here ...
}
Besides, speaking of the comments. This is a compile (or more precisely a Link) error, not a run-time error. When you start to debug, the compiler needs to make a complete program (not just to compile your module) and that is when the error occurs.
It does not even get to the point being loaded and run.