Sorry for the late reply. Here's what you asked for:
1. I created a new project (just a console project).
2. Without changing any of the default code, I created a new class.
3. I added it to the current project.
4. I added the #include directive in main.cpp, and upon attempting to build the project, the 'undefined reference to WinMain@16' error appears.
5. I saved the project, closed it, and reopened it again.
6. When rebuilding the project, it works fine.
Not sure why this works, but closing the project and reopening it (or restarting Code::Blocks) solves the problem consistently.