[Linking error] undefined reference to `WinMain'

I have searched and read about this error, but the questions and answers are too advanced for me.

I need help fixing it so I can compile this and see if it works. I don't understand why this one particular function call causes this error.

This is my 3rd week studying C++ in a Logic and Programming class.
We're supposed to use global constants, pass arguments by reference, functions in a sequence structure.

Pretty much on our own about learning to use IDEs.

I'm running Windows 7, and wxDev-C++

Please help formula? typos? compiler?

Thank you for any help.




line 38 In function 'main'::
[Linker Error] undefined reference to 'WinMain@16'
id returned 1 exit status


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  

#include <iostream>


using namespace std; 

//Global Constants

  const double CALC_AREA_BASE = 115; /* area base for gallons of paint and hours of labor*/
  const double GALLONS_PER_CALC_AREA_BASE = 1; 	/* 1 gallon paint per 115 sq. ft.*
  const double LABOR_HOURS_PER_CALC_AREA_BASE = 8; /*8 hours of labor needed to paint 115 sq. ft.*/ 
  const double LABOR_RATE = 20;	//$20.00 per hour

//Function Prototypes
void userEnter(double &eArea, double &ePriceGallon);
void figureArea(double &eArea, double &fArea, double &ePriceGallon, double      &neededGallon, double &hrsLabor, double &totalPaintcost, double &totalLaborWages);
void jobCost(double &totalLaborWages, double &totalPaintCost, double &totalJobCost);

int Main ()
{
// title of calculator
  cout << "Estimate the Cost of a Paint Job." << endl;
  
  double eArea = 0;  		// "e" entered
  double fArea = 0;		//"f" formula
  double ePriceGallon = 0;
  double neededGallon =0;
  double hrsLabor = 0;
  double wagesLabor = 0;
  double totalPaintCost = 0;
  double totalLaborWages = 0;
  double totalJobCost = 0;
  
  userEnter(eArea, ePriceGallon);
  cout << "Are the amounts correct?  If so press enter, if not press esc." <<  endl;
             //problem area
  figureArea(eArea, fArea, ePriceGallon, neededGallon, hrsLabor, totalPaintCost, totalLaborWages);    // <<<<<<<<<<< this is the problem

  cout <<"Gallons of paint needed: " << endl;
  cout <<"Total price of paint: " << endl;
  cout <<"Labor hours needed: " << endl;
  cout <<"Labor cost: " << endl;
  
  jobCost(totalLaborWages, totalPaintCost, totalJobCost);  
  cout << "The paint job total is: " << endl; 
  
  cin.get();
  cin.get();
  
  return 0;
}

void userEnter(double &eArea, double & ePriceGallon)  
{ 
}


void figureArea(double &eArea, double &fArea, double &ePriceGallon, double &neededGallon, double &hrsLabor, double &totalPaintCost, double &totalLaborWages) 
{

   neededGallon = (eArea / CALC_AREA_BASE) * GALLONS_PER_CALC_AREA_BASE;
   totalPaintCost = neededGallon * ePriceGallon; 
   hrsLabor = (eArea / CALC_AREA_BASE) * LABOR_HOURS_PER_CALC_AREA_BASE;
   totalLaborWages = hrsLabor * LABOR_RATE;
}
void jobCost(double &totalLaborWages, double &totalPaintCost, double &totalJobCost)
{ 
  totalJobCost = totalLaborWages + totalPaintCost;  //this is the 
}

line 20: int Main ()
Thank you norm b, it compiles now but doesn't work.

Do you know of a very simple IDE with compiler?
You're welcome.

There are a lot of threads on the forum about IDE's.

Here are a couple:
http://www.cplusplus.com/forum/general/89556/
http://www.cplusplus.com/forum/general/62858/

I'm a Linux user so I don't know which IDE would be most suitable for Windows. For simple apps I just use an editor and the command line. I have been using Qt recently so I use QtCreator for more complex projects. http://en.wikipedia.org/wiki/Qt_Creator

Review the threads on here and if someone else doesn't comment in this thread, start a new thread asking about specific IDE's.
Topic archived. No new replies allowed.