title: Precompiled header error
body: <p>I have a simple program with three files(excluding the precompiled header).
  I have included the precompiled header in the .cpp files
  Yet it is giving these two errors that I don't seem to understand :</p>
  
  <p>1>d:\practice\operatoroverloading\oopinheritance\oopinheritance\commisionemp.h(4): warning C4627: '#include ': skipped when looking for precompiled header use
  1>          Add directive to 'StdAfx.h' or rebuild precompiled header
  1>d:\practice\operatoroverloading\oopinheritance\oopinheritance\commisionemp.h(35): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
  ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========</p>
  
  <p>Here are the codes:</p>
  
  <pre><code>OOPInheritance.cpp
  
          // OOPInheritance.cpp : Defines the entry point for the console application.
          //
  
          #include "stdafx.h"
          #include &lt;iostream&gt;
          #include &lt;iomanip&gt;
          #include "CommisionEmp.h"
  
          using namespace std;
  
          int _tmain(int argc, _TCHAR* argv[])
          {
              CommissionEmp employee("Dede","Kikadi","777-77-7777",5000,0.08);
  
              cout&lt;&lt;fixed&lt;&lt;setprecision(2);
  
              cout&lt;&lt;"Employee information obtained by get functions:\n"
                  &lt;&lt;"\n First name is" &lt;&lt;employee.getFirstName()
                  &lt;&lt;"\n Last name is "&lt;&lt;employee.getLastName()
                  &lt;&lt;"\nSocial security number is"
                  &lt;&lt;employee.getSocialSecurityNumber()
                  &lt;&lt;"\nGross sales is " &lt;&lt;employee.getGrossSales()
                  &lt;&lt;"\nCommission rate is " &lt;&lt;employee.getCommissionRate()&lt;&lt;endl;
  
              employee.setGrossSales(8000);
              employee.setCommissionRate(.1);
  
              cout&lt;&lt;"\n Updated employee infromation output by print function : \n"&lt;&lt;endl;
              employee.print();
  
              cout&lt;&lt;"\n Employee's earning : ZAR"&lt;&lt;employee.earnings()&lt;&lt;endl;
              return 0;
          }
  
  CommisionEmp.h:
  
          #ifndef COMMISSION_H
          #define COMMISSION_H
  
          #include &lt;string&gt;
          using namespace std;
  
          class CommissionEmp{
          public:
              CommissionEmp(const string &amp;, const string &amp;, const string &amp;, double=0.0, double =0.0);
              void setFirstName(const string &amp;);
              string getFirstName() const;
  
              void setLastName(const string &amp;);
              string getLastName() const;
  
              void setSocialSecurityNumber(const string &amp;);
              string getSocialSecurityNumber() const;
  
              void setGrossSales(double);
              double getGrossSales() const;
  
              void setCommissionRate(double);
              double getCommissionRate() const;
  
              double earnings()const;
              void print() const;
          private:
              string firstName;
              string lastName;
              string socialSecurityNumber;
              double grossSales;
              double commissionRate;
          };
          #endif
  
  CommissionEmp.cpp:
  
          #include "stdafx.h"
          #include &lt;iostream&gt;
          #include "CommisionEmp.h"
  
          using namespace std;
  
          CommissionEmp::CommissionEmp(const string &amp;first, const string &amp;last, const string &amp;ssn, double sales, double rate) :
          firstName(first), lastName (last), socialSecurityNumber(ssn)
          {
              setGrossSales(sales);
              setCommissionRate(rate);
          }
  
          void CommissionEmp::setFirstName(const string &amp;first)
          {
              firstName=first;
          }
          string CommissionEmp::getFirstName()const {return firstName;}
  
          void CommissionEmp::setLastName (const string &amp;last)
          {
              lastName=last;
          }
          string CommissionEmp::getLastName()const {return lastName;}
  
          void CommissionEmp::setSocialSecurityNumber (const string &amp;ssn)
          {
              socialSecurityNumber=ssn;
          }
          string CommissionEmp::getSocialSecurityNumber()const {return socialSecurityNumber;}
  
          void CommissionEmp::setGrossSales (double sales)
          {
              if(sales &gt;= 0.0)
                  grossSales=sales;
              else throw invalid_argument("Gross sales must be &gt;=0.0");
          }
          double CommissionEmp::getGrossSales()const {return grossSales;}
  
          void CommissionEmp::setCommissionRate (double rate)
          {
              if(rate&gt;0.0 &amp;&amp; rate &lt;1.0)
                  commissionRate=rate;
              else throw invalid_argument("Commission rate must be &gt; 0.0 and &lt; 1.0");
          }
          double CommissionEmp::getCommissionRate()const {return commissionRate;}
          double CommissionEmp::earnings() const{
          return commissionRate*grossSales;
          }
          void CommissionEmp::print() const{
              cout&lt;&lt;"commission empoyee: " &lt;&lt;firstName &lt;&lt;' ' &lt;&lt;lastName
                  &lt;&lt;"\n social security number : "&lt;&lt;socialSecurityNumber
                  &lt;&lt;"\ngross sales: "&lt;&lt; grossSales
                  &lt;&lt;"\ncommission rate: "&lt;&lt;commissionRate;
          }
  </code></pre>