I'm new to C and I'm trying to compile a HelloWorld program. I'm using GNU GCC 4.9.2. I've looked online for many solutions but none of them worked: Every time I compile the program, it hits me with this error:
"Undefined reference to 'WinMain@16'"
Please bear in mind that I HAVE configured the project as a console project, not a windows project and that I have written the main function correctly.
Here's the code:
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
Finally, note that I can successfully compile, build, and run C++ programs with code blocks. For some reason, I can't do the same for C. Additionally, I tried compiling the source file from the command line and the issue still persisted.
Compilation lines: