Sunday, 21 May 2017

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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...