title: Error: "Undefined reference to 'main'"
body: <p>I am compiling a c++ program but i keep getting lines of code that make no sense and then at the bottom of it all it says "undefined reference to 'menu'". I have a .h file and a .cpp file, menu function is defined in my .h file, in my .cpp file i include my .h file at the top and this is also where I implement my menu function. And yes, I am compiling them at the same time</p>
  
  <i>header file</i>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cctype&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  /*
  struct dog_park
  {
     char * name;
     char * location;
     char * description;
     char * fence;
     char * size;
  
  };
  */
  class parks
  {
  
     public:
        struct dog_park
        {
           char * name;
           char * location;
           char * description;
           char * fence;
           char * size;
        };
        parks();
        int menu();
        bool display_all();
        void add_park();
        bool search_park();
        ~parks();
  
     private:
        dog_park * all_parks;
        int length;
  
  
  };
  </code></pre>
  
  <i>.cpp file</i>
  
  <pre><code>//implementation of functions 
  
  #include "cs162_parks.h"
  
  parks::parks()
  {
     all_parks = new dog_park[length];   
  
  }
  
  //allows for user to select what action to take
  int parks::menu()
  {
     int choice = 0;
     cout &lt;&lt; "Welcome to the menu, your choices to choose from are: " &lt;&lt; endl &lt;&lt; endl;
     cout &lt;&lt; "1. Add a dog park to list" &lt;&lt; endl;
     cout &lt;&lt; "2. Search for specific park by name" &lt;&lt; endl;
     cout &lt;&lt; "3. Display all dog parks" &lt;&lt; endl;
     cout &lt;&lt; "4. Quit" &lt;&lt; endl &lt;&lt; endl;
     cout &lt;&lt; "What menu selection do you choose? (1-4): ";
     cin &gt;&gt; choice;
     cin.ignore(100, '\n');
  
     return choice;
  }
  
  parks::~parks()
  {
     if (all_parks)
        delete [] all_parks;
  }
  </code></pre>