title: (.text+0x20): undefined reference to `main' When trying to Compile .cpp file
body: <p>when trying to compile a .cpp file called rat with a .h file called normalize which is located in a different folder (rat.h is in the same folder as rat.cpp) , I'm typing</p>
  
  <pre><code>g++ -I/opt/cis/include/ -I/opt/cis/lib/ rat.cpp
  </code></pre>
  
  <p>I have included an int main () in the .cpp file itself, and have completely commented out the inner workings of the .h file and the .cpp file just to try to compile correctly.  </p>
  
  <p>The .h file (commented items not included)</p>
  
  <pre><code>  1 #ifndef RAT_H
    2 #define RAT_H
    3 #include &lt;iostream&gt;
    4 #include &lt;string&gt;
    5 
    6 class Rat {
    7         friend std::ostream &amp;operator&lt;&lt;(std::ostream &amp;, const Rat &amp;);
    8         friend std::istream &amp;operator&gt;&gt;(std::istream &amp;, Rat &amp;);
    9         private:
   10                 double n,d;
   11         public: 
   12                 Rat(): n(0), d(1) {}
   13 };
   14. #endif
  </code></pre>
  
  <p>The .cpp file</p>
  
  <pre><code>  1 #include &lt;iostream&gt;
    2 #include &lt;cstdlib&gt;
    3 #include &lt;string&gt;
    4 #include &lt;sstream&gt;
    5 #include "rat.h"
    6 #include "normalize.h"
    7 using namespace std;
    8 #ifdef TEST_RAT
    9 int main() {};
    10 #endif
  </code></pre>
  
  <p>What am I doing incorrectly?  Sorry if it is obvious.</p>