How do I solve the following errors: “Undefined reference to WinMain”, “[Error] Id returned 1 exit status”?

This error means that the linker is looking for a function named WinMain to use as the entry point. It would be doing that because you configured the project to target the GUI subsystem, but did not provide a WinMain function.

My guess is that you want to produce a console application and have provided a main function. Target the console subsystem to resolve the problem.

Leave a Comment