title: Function identifier is undefined C++
body: <p>So I am writing a function in C++ that is a small database, containing two classes, exercise and diet. These two classes are very similar, basically exactly alike. Anyway I am trying to print the contents of my exercise class. However I am getting an error message that the function StoreDailyPlan is undefined. This is interesting because both classes have their own version of that overloaded function, and the diet version is working just fine.</p>
  
  <pre><code>void Wrapper::storeWeeklyPlan(ofstream&amp; outfile, list&lt;DietPlan&gt;&amp; dietlist)
  {
  DietPlan Node;
  list&lt;DietPlan&gt;::iterator it; //this is our iterator, a pointer to the nodes in our list.
  
  for(it = dietlist.begin(); it != dietlist.end(); it++) // start it at beginning, watch until end, and iterate it.
  {
      Node = *it;
      storeDailyPlan(Node, outfile);
  } //Another error here
  
  }
  
  void storeWeeklyPlan(ofstream&amp; outfile, list&lt;ExercisePlan&gt;&amp; exerciselist)
  {
  ExercisePlan Node;
  list&lt;ExercisePlan&gt;::iterator it;
  
  for (it = exerciselist.begin(); it != exerciselist.end(); it++)
  {
      Node = *it;
      storeDailyPlan(Node, outfile); //THIS IS THE ERROR LINE
  }
  
  }
  
  void Wrapper::storeDailyPlan(DietPlan diet, ofstream&amp; outfile)
  {
      outfile &lt;&lt; diet;
  }
  
  void Wrapper::storeDailyPlan(ExercisePlan exercise, ofstream&amp; outfile)
  {
      outfile &lt;&lt; exercise;
  }
  </code></pre>
  
  <p>Above are the 4 functions directly responible for printing the information onto the file. Below is some other relevant code.</p>
  
  <pre><code>class Wrapper
  {
  public:
  Wrapper();
  ~Wrapper();
  void runApp();
  private:
  int displayMenu();
  void doChoice(int choice, list&lt;DietPlan&gt;&amp; dietList, list&lt;ExercisePlan&gt;&amp; exerciselist);
  
  void loadDailyPlan(DietPlan&amp; diet, ifstream&amp; infile);
  void loadDailyPlan(ExercisePlan&amp; exercise, ifstream&amp; infile);
  
  void loadWeeklyPlan(ifstream&amp; infile, list&lt;DietPlan&gt;&amp; dietlist);
  void loadWeeklyPlan(ifstream&amp; infile, list&lt;ExercisePlan&gt;&amp; exerciselist);
  
  void storeWeeklyPlan(ofstream&amp; outfile, list&lt;DietPlan&gt;&amp; dietlist);
  void storeWeeklyPlan(ofstream&amp; outfile, list&lt;ExercisePlan&gt;&amp; exerciselist);
  
  void storeDailyPlan(DietPlan diet, ofstream&amp; outfile);
  void storeDailyPlan(ExercisePlan exercise, ofstream&amp; outfile);
  
  
  list &lt;DietPlan&gt; dietlist; //doubly linked list of DietPlan nodes. This is where it lives.
  list &lt;ExercisePlan&gt; exerciselist;
  };
  </code></pre>
  
  <p>Please let me know if you would like to see any other code. Like I said, the diet version of the overloaded function works just fine.</p>
  
  <p>The Errors I get are identifier "storeDailyPlan" is undefined and 
  'storeDailyPlan': identifier not found</p>
  
  <p>I am using Visual Studio 2015.</p>