Linker Error

Hi all,

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:

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.

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens

The above link implies missing or wrong order of "-lmingw32" can cause issue.

Tim S.

Last edited by stahta01; 01-26-2012 at 11:14 AM.

"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson