Here is class for rational numbers
Qt Code:
  1. #ifndef RATIONAL_H
  2. #define RATIONAL_H
  3.  
  4. class rational{
  5. public:
  6. rational(short =0,short=0,short=0, short=0);
  7. ~rational();
  8. void setRational(short =0,short=0,short=0, short=0);
  9. void Add();
  10. void Subtract();
  11. void Multiply();
  12. void Divide();
  13. void PrettyPrint(char ch);
  14. void floatPrint();
  15. private:
  16. short r1;
  17. short r2;
  18. short r3;
  19. short r4;
  20. };
  21. #endif // RATIONAL_H
To copy to clipboard, switch view to plain text mode 

Upon compiling I get an error for my destructor:
H:\C++_How_To_Program\chap06\rational_numbers/main.cpp:101: undefined reference to `rational::~rational()'

This occurs in any class I create. I can't figure out why.