unresolved external 'WinMain'

error while running the code although there is no error when debug

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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
 #include <iostream.h>
#include <stdio.h>
#include <conio.h>
#include "HotelQueueLinkedList.h"



int main()
{
 	cout << "=========================================" << endl;
   cout << "\tROOM INFORMATION" << endl;
   cout << "=========================================" << endl << endl;

  HotelLinkedList* Cust = new HotelLinkedList();
	Cust->insert(11, "Family", "Asmah", "2012-10-09", 59.00);

   int choice = 0;

   while (choice != 8)
   {

   	cout << "--------" << endl << "Menu: " << endl << "--------" << endl;
   	cout << "\t1: Book a Room" << endl;
  		cout << "\t2: Display Room" << endl;
      cout << "\t3: Display Room in Reverse order" << endl;
   	cout << "\t4: Display 1st Booked Room" << endl;
   	cout << "\t5: Display last Booked Room" << endl;
      cout << "\t6: Search Room" << endl;
   	cout << "\t7: Delete 1st customer" << endl;
		cout << "\t8: Exit" << endl;
		cout << "Choice (1 to 8): ";
		cin >> choice;

   	switch(choice)
   	{
			case 1:
      	{
      		cout << "---- Add New Booking ----" << endl;
        	 int c;
        	 double p;
          char t[50], a[50], d[10];

          cout << "Enter Room No: ";
          cin >> c;
          cout << "Enter Room Type";
        	 cin >> t;
          cout << "Enter Customer Name: ";
      	 cin >> a;
          cout << "Enter Booking Date: ";
          cin >> d;
          cout << "Enter Price: RM ";
          cin >> p;

          Cust->insert(c,t,a,d,p);
      	}
      	break; // option 1
      	case 2:
      	{
      		cout << endl << "******** Room List ********" << endl << endl;
         	Cust->display();
            cout << endl << "******** End of List ********" << endl << endl;
   		}
      	break; // option 2
      	case 3:
      	{
      		cout << endl << "******** Room List (Reverse Order) ********" << endl << endl;
         	Cust->displayReverse();
            cout << endl << endl << "******** End of List ********" << endl;
      	}
      	break; // option 3
      	case 4:
     		{
      		cout << endl << "******** 1st customer in Queue ********" << endl << endl;
         	cout << "1st customer in Queue: " << Cust->getFront() << endl << endl;
      	}
      	break; // option 4
      	case 5:
     	 	{
      		cout << endl << "******** Last customer in Queue ********" << endl << endl;
         	cout << "Last customer in Queue: " << Cust->getRear() << endl << endl;
      	}
      	break; // option 5
         case 6:
         {
         	cout << endl << "******** Search Room ********" << endl << endl;
            cout << "Enter Room No: ";
            int sk;
            cin >> sk;
            bool jumpa = Cust->search(sk);
            if (jumpa)
            {
            	cout << "Room No " << sk << " is available" << endl;
         		cout << "--------------------" << endl;
            }
            else
              	cout << "Room not found! or have been booked!" << endl;
         }
         break; // option 6
      	case 7:
      	{
      		cout << endl << "******** Delete 1st Customer ********" << endl << endl;
         	cout << "Customer " << Cust->deleteData() << " will be deleted..." << endl;
         	cout << "Deleted!" << endl << endl;
      	}
      	break; // option 7
         default:
      		cout << "Invalid choice! Try again~" << endl << endl;
   	} // end switch
	} // end while
   // option 8
   cout << "Thank you for using this program~! :D" << endl << endl;
   delete Cust;
   getch(); //thank user for using program, exit
}
make sure you created your project as a"console application" not "windows application", "dll", or "static lib" or something else ( i can't remember )
Last edited on
i have create the project as console application. but. still the same error occur
what ide are you using ? take a look at this similar thread :

http://stackoverflow.com/questions/6626397/error-lnk2019-unresolved-external-symbol-winmain16-referenced-in-function

BTW, <iostream.h> and <stdio.h> should be :
<iostream> and <cstdio>

it's the C++ way to include it
Topic archived. No new replies allowed.