undefined reference to `WinMain@16' in eclipse

Hello, I've gotten this linking error for some time now, and I've been trying to figure out how to solve it, but no luck so far.
I'm using Eclipse CDT, with 32bit MinGW as my compiler and linker.
Here is a the main function of my source code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
int main(int argc,char **argv)
{
	initscr();
	clear();
	start_color();
	atexit(quitAll);
	printw("Starting up SubNet\n");
	try
	{
		init_commands();
		loop();
	} catch (const SubNetException& e)
	{
		cout << e.what() << endl;
	}

	return 0;
}

And I'm getting this linking error:
C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to `WinMain@16'
I know that it's trying to use a windows entry point for a GUI program(this is a console program).
Bump
With visual C++ it's an indicator that you choose the wrong project type (Win32 instead of console). I don't know whether that applies to eclipse
Eclispe CDT C++ default projects are pretty bare bones standard.
Eclispe CDT C++ default projects are pretty bare bones standard.


I didn't know there was a bare bones standard. Or what that means, even. It's fairly obvious eclipse thinks you're not compiling a console program. Check your project settings. Asking at a place where eclipse is topical might result in more helpful responses. Or, if this is as common in Eclipse as it is in other development environments, googling may prove productive.
Last edited on
When I say bare bones, I mean: "g++ -Wall *.cpp -oprogram.exe -llua" as an example basically.
Topic archived. No new replies allowed.