Sunday, 28 January 2018

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

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...