I have written a code for a program which detects whether a number is a factorial number or not. I am getting a linker error saying "undefined reference to WinMain@16" after compilation
of my program. Kindly help me to solve this problem. Thank you. Below is my code:
printf("Enter n to be checked");
if(n==1 || n==2)
printf("n is a factorial number");
What compiler are you using, include the version information? What version of Windows are you using?
Thank you for your prompt reply. I am using Mingw GCC compiler and windows seven enterprise edition.
Originally Posted by jimblumberg
It thinks you are trying build a Windows executable instead of a console application. This is probably a setting somewhere but I've never used Mingw/GCC.
IIRC, try option "-mwindows"
SDL :: View topic - SDL_mixer's playwave.exe linking error with SDL 1.2.15 on mi
The above link implies missing or wrong order of "-lmingw32" can cause issue.