title: Call to non-static member function without an object argument
body: <p>Can anyone explain this error any why I am getting it? I believe I've got all of the arithmetic down in my separate class.</p>
  
  <p>This program stores and manipulates fractions, while testing overloading.</p>
  
  <p>Thank you in advance.</p>
  
  <p>I am trying to test this in the driver with the output looking like this.</p>
  
  <pre><code>f1 = 3/6, f2 = 4/5 
  f1 + f2 = 39/30 = 13/10 = 1.3 
  f1 - f2 = -9/30 = -3/10 = -0.3 
  f1 * f2 = 12/30 = 2/5 = 0.4 
  f1 / f2 = 15/24 = 5/8 = 0.625 
  Enter a fraction [numerator denominator]: 2 5 
  You entered 2/5 
  </code></pre>
  
  <p>My Fraction.cpp class</p>
  
  <pre><code>#include "Fraction.h"
  
  #include &lt;iostream&gt;
  
  using namespace std;
  
  Fraction::Fraction(const int numerator, const int denominator) {  }
  
  int Fraction::getNumerator() const {
      return numerator;
  }
  
  int Fraction::getDenominator() const {
      return denominator;
  }
  
  int Fraction::gcd() const {
      int n = numerator;
      int d = denominator;
      int temp;
  
      while (d!=0) {
          temp = n % d;
          n = d;
          d = temp;
      }
  
      return n;
  
  }
  
  void Fraction::setNumerator(const int numerator) {
      this-&gt;numerator = numerator;
  }
  
  void Fraction::setDenominator(const int denominator) {
      this-&gt;denominator = denominator;
  }
  
  string Fraction::toString() const {
      return "";
  }
  
  double Fraction::returnDecimal() const {
      double a = (double) getNumerator();
      double b = (double) getDenominator();
  
      return (a / b);
  }
  
  void Fraction::reduce()  {
  
      int a = gcd();
      int b = numerator / a;
      int c = denominator / a;
  
      setNumerator(b);
      setDenominator(c);
  
  }
  
  Fraction Fraction::operator +(const Fraction&amp; f) const {
  
      Fraction temp;
  
      int a = getNumerator();
      int b = getDenominator();
      int c = f.getNumerator();
      int d = f.getDenominator();
  
      int tempOne = b;
      int tempTwo = d;
  
      a = a * tempTwo;
      b = b * tempTwo;
  
      c = c * tempOne;
      d = d * tempOne;
  
      temp.setNumerator(a+c);
      temp.setDenominator(d);
  
      return temp;
  
  }
  
  Fraction Fraction::operator -(const Fraction&amp; f) const {
  
      Fraction temp;
  
      int a = getNumerator();
      int b = getDenominator();
      int c = f.getNumerator();
      int d = f.getDenominator();
  
      int tempOne = b;
      int tempTwo = d;
  
      a = a * tempTwo;
      b = b * tempTwo;
  
      c = c * tempOne;
      d = d * tempOne;
  
      temp.setNumerator(a-c);
      temp.setDenominator(d);
  
      return temp;
  
  }
  
  Fraction Fraction::operator *(const Fraction&amp; f) const {
  
      Fraction temp;
  
      temp.setNumerator(getNumerator() * f.getNumerator());
      temp.setDenominator(getDenominator() * f.getDenominator());
  
      return temp;
  
  }
  
  Fraction Fraction::operator /(const Fraction&amp; f) const {
  
      Fraction temp;
  
      temp.setNumerator(getNumerator() * f.getDenominator());
      temp.setDenominator(getDenominator() * f.getNumerator());
  
      return temp;
  
  }
  
  bool Fraction::operator ==(const Fraction&amp; f) const {
  
      return ( (getNumerator() == f.getNumerator()) &amp;&amp; (getDenominator() == f.getDenominator()) );
  
  }
  
  bool Fraction::operator !=(const Fraction&amp; f) const {
  
      return !( (getNumerator() == f.getNumerator()) &amp;&amp; (getDenominator() == f.getDenominator()) );
  
  }
  
  bool Fraction::operator &lt;(const Fraction&amp; f) const {
  
      double a = getNumerator();
      double b = getDenominator();
  
      double c = getNumerator();
      double d = getDenominator();
  
      return ((a/b) &lt; (c/d));
  
  }
  
  bool Fraction::operator &lt;=(const Fraction&amp; f) const {
  
      double a = getNumerator();
      double b = getDenominator();
  
      double c = getNumerator();
      double d = getDenominator();
  
      return ((a/b) &lt;= (c/d));
  
  }
  
  bool Fraction::operator &gt;(const Fraction&amp; f) const {
  
      double a = getNumerator();
      double b = getDenominator();
  
      double c = getNumerator();
      double d = getDenominator();
  
      return ((a/b) &gt; (c/d));
  
  }
  
  bool Fraction::operator &gt;=(const Fraction&amp; f) const {
  
      double a = getNumerator();
      double b = getDenominator();
  
      double c = getNumerator();
      double d = getDenominator();
  
      return ((a/b) &gt;= (c/d));
  
  }
  
  ostream&amp; operator &lt;&lt;(ostream&amp; out, const Fraction&amp; f) {
      out &lt;&lt; f.getNumerator() &lt;&lt; "/" &lt;&lt; f.getDenominator();
  
      return out;
  }
  
  istream&amp; operator &gt;&gt;(istream&amp; in, Fraction&amp; f) {    
  
      int a;
      int b;
  
      in &gt;&gt; a &gt;&gt; b;
  
      f.setNumerator(a);
      f.setDenominator(b);
  
      return in;
  
  }
  </code></pre>
  
  <p>My main class.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Fraction.h"
  #include "Fraction.cpp"
  using namespace std;
  
  int main(int argc, const char * argv[])
  {
  
      Fraction::getNumerator() const;
      Fraction::getDenominator() const;
      Fraction::gcd() const;
      Fraction::setNumerator(&lt;#const int numerator#&gt;);
      Fraction::setDenominator(&lt;#const int denominator#&gt;);
      Fraction::toString();
      Fraction::returnDecimal() const;
      Fraction::reduce();
  
      return 0;
  }
  </code></pre>
  
  <p>Fraction.h</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class Fraction {
  
  private:
  
      int numerator;
  
      int denominator;
  
      int gcd() const;
  
  public:
  
      Fraction(const int numerator = 0, const int denominator = 0);
  
      int getNumerator() const;
  
      int getDenominator() const;
  
      void setNumerator(const int numerator);
  
      void setDenominator(const int denominator);
  
      string toString() const;
  
      double returnDecimal() const;
  
      void reduce();
  
      bool operator ==(const Fraction&amp; f) const;
  
      bool operator !=(const Fraction&amp; f) const;
  
      bool operator &lt;(const Fraction&amp; f) const;
  
      bool operator &lt;=(const Fraction&amp; f) const;
  
      bool operator &gt;(const Fraction&amp; f) const;
  
      bool operator &gt;=(const Fraction&amp; f) const;
  
      Fraction operator +(const Fraction&amp; f) const;
  
      Fraction operator -(const Fraction&amp; f) const;
  
      Fraction operator *(const Fraction&amp; f) const;
  
      Fraction operator /(const Fraction&amp; f) const;
  
      friend ostream&amp; operator &lt;&lt;(ostream&amp;, const Fraction&amp;);
  
      friend istream&amp; operator &gt;&gt;(istream&amp;, Fraction&amp;);
  
  };
  </code></pre>