Link to home
Start Free TrialLog in
Avatar of mustish1
mustish1

asked on

Error duing compilation

Hi guys: Can any one please tell me what does this error means ?


Compiler: Default compiler
Executing  g++.exe...
g++.exe "C:\Documents and Settings\Kathy\My Documents\test.cpp" -o "C:\Documents and Settings\Kathy\My Documents\test.exe"    -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include"  -I"C:\Dev-Cpp\include\c++\3.4.2\backward"  -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32"  -I"C:\Dev-Cpp\include\c++\3.4.2"  -I"C:\Dev-Cpp\include"   -L"C:\Dev-Cpp\lib"
C:\Dev-Cpp\lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status

Execution terminated
-----------------------------------------------------------------------

#include<string>
using namespace test;

class Employee
      {
      public:
             Employee();
             Employee(string, double);
             void setEmployee(string, double);
             double getSalary();
             string getName();
             void calcNewSalary(double);
      private:
              string name;
              double salary;
      };
      Employee::Employee()
             {
             name = "";
             salary = 0.0;
             }
      Employee::Employee(string n, double s)
             {
             name = n;
             salary = s;
             }
      void Employee::setEmployee(string n, double s)
             {
             name = n;
             salary = s;
             }
      double Employee::getSalary()
             {
             return salary;
             }
      string Employee::getName()
             {
             return name;
             }
      void Employee::calcNewSalary(double r)
             {
             if(r >=0.0)
                   salary = salary * r + salary;
             else
                    salary = 0.0;
             }
SOLUTION
Avatar of mrjoltcola
mrjoltcola
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mustish1
mustish1

ASKER

Im sorry i forgett main.

#include<string>
#include<iostream>
using namespace test;
class Employee
      {
      public:
             Employee();
             Employee(string, double);
             void setEmployee(string, double);
             double getSalary();
             string getName();
             void calcNewSalary(double);
      private:
              string name;
              double salary;
      };
      Employee::Employee()
             {
             name = "";
             salary = 0.0;
             }
      Employee::Employee(string n, double s)
             {
             name = n;
             salary = s;
             }
      void Employee::setEmployee(string n, double s)
             {
             name = n;
             salary = s;
             }
      double Employee::getSalary()
             {
             return salary;
             }
      string Employee::getName()
             {
             return name;
             }
      void Employee::calcNewSalary(double r)
             {
             if(r >=0.0)
                   salary = salary * r + salary;
             else
                    salary = 0.0;
             }
int main()
{
    Employee myEmployee;
    string name = "";
    double pay = 0;
    double rate = 0.0;
    cout << "Employee's name:";
    getline(cin, name);
    cout << "Employee's current salary:";
    cin >> pay;
    cin.ignore(100, '\n');
    cout << "Raise rate:";
    cin >> rate;
    cin.ignore(100, '\n');
    myEmployee.setEmployee(name, pay);
    cout << "Name:" << myEmployee.getName() << endl;
    cout << "Current salary: $" << myEmployee.getSalary() << endl;
    myEmployee.calcNewSalary(rate);
    cout << "New salary: $" << myEmployee.getSalary() << endl;
    system("pause");
    return 0;
}