I was creating a new project and trying to run it as an x86. I forgot to go into the project settings, Linker, System and change from Console subsystem to Windows subsystem. It will run without the annotations as long as everything is declared in the main file.
How to fix Win32 error 2731 on WinMain() function cannot be overloaded.
Gary Myers
0
Reputation points
I am writing code for an x86 project in Studio 2022. The code comes from a book on game programming. Everytime I try to compile the program, I get the error message 2731 stating that the WinMain() function cannot be overloaded. My declaration is the following:
int APIENTRY wWinMain(In HINSTANCE hInstance, In_opt HINSTANCE hPrevInstance, In PSTR szCmdLine, In int iCmdShow)
If I leave out the 'I n' I get a linker error instead.
How can I fix this issue?