How to fix the following error message when trying to compile C++ console application project on Code::Blocks?
undefined reference to `WinMain'
All other questions on Stack Overflow are about "WinMain@16", which is not the case here.
How to fix the following error message when trying to compile C++ console application project on Code::Blocks?
undefined reference to `WinMain'
All other questions on Stack Overflow are about "WinMain@16", which is not the case here.
WinMain is linked to in windows when you want to create a windows application.
https://learn.microsoft.com/en-us/windows/win32/learnwin32/winmain--the-application-entry-point
For the complier to look for the main function you will have to change at the linker stage that it is a console application and not a windowed one.
Or you might just need to restart CodeBlocks: C++ undefined reference to WinMain@16 (Code::Blocks)
Or you might have just have deleted main()
;)