Sunday, January 28, 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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...