Tuesday, August 13, 2019

c++ - GNU GCC: undefined reference to `WinMain@16' when attempting to compile release (Code::Blocks)

I was looking for the .exe of my program and I couldn't find any in the release folder, so I decided to explicitly compile release.
But here's what I get every time I attempt to compile:
e:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\libmingw32.a(main.o):main.c:(.text.startup+0xa7)||undefined reference to 'WinMain@16'|



From googling around it looks like it's a linker error, but how the heck can I take care of it?



My program consists of main.cpp and the following includes: (It's a console application)




#include 
#include
#include
#include
#include
#include "AVLTree_GeeksforGeeks.h" //Consists of an extra .cpp
#include
#include
#include


int main()
{
/*
code
*/
return 0;
}


I'm a bit tired as it's 1am here and I'm trying to get some ideas on what might be wrong.

Should I just try compiling from console?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...