I always get this error 'Undefined reference to WinMain@16' after creating a class in Code::Blocks. I have to restart it to make the program works.
Why ?
Thank you!
I always get this error 'Undefined reference to WinMain@16' after creating a class in Code::Blocks. I have to restart it to make the program works.
Why ?
Thank you!
If you have only one file - your class - and you trying to compile it, you will get this error because file don't have int main()
function. It's required by linker to create executable (start point of program).
If you have project with classes, you must have one main
function, for example in main.cpp
file :)
Also, check that you selected a Console application - GUI (Windows application) neeed WinMain function instead of classical main.
Of course, this is about normal program - library have other requirements.