Unresolved External Symbol(i found where this symbol is)

but i cannot solved the problem. here is the code which belongs to a cpp file of a header.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  extern int main ();

static bool zombies = false;


DWORD WINAPI ThreadFunc (LPVOID)
{
	zombies = true;
	main();
	zombies = false;

	RobotWindow::running = false;
	UserMessage(theRobotWindow, mboxOK, "Stop", "End of execution");

	return 0;
}


error;
1>robots_modified.obj : error LNK2001: unresolved external symbol _main
1>d:\users\suuser\documents\visual studio 2010\Projects\hw5.2\Debug\hw5.2.exe : fatal error LNK1120: 1 unresolved externals

when i write // to 2nd line of ThredFunc(front of Main();), i dont get compiler error yet this function is crucial to end my program.

awkward thing is that i use same function in an alternative project and it works completely fine. is it because i run same cpp file in two different project? yet i have two copies of this cpp in project files.
It is just interesting where did you copy this code from? Where did you see such declaration of main?
Last edited on
our instructor gave us that cpp file and its header. also including 3 other cpp-header team. we are expected to just implement some functions to one cpp-header team and write a main.
Last edited on
According to the C++ Standard

An implementation shall not predefine the main function.
Topic archived. No new replies allowed.