title: Class '' has no member named ''
body: <p>I have created several source files with associated headers and declared/defined functions.  I keep getting an error saying that a class does not have a member.  I am calling a set function that clearly associates a member to my private member.  Is there something else that I should be including?</p>
  
  <pre><code>#ifndef STUDENTCOLLECTION_H
  #define STUDENTCOLLECTION_H
  
  #include&lt;string&gt;
  #include&lt;vector&gt;
  #include&lt;iostream&gt;
  #include&lt;fstream&gt;
  
  using namespace std;
  
  #include "StudentProfile.h"
  #include "Person.h"
  #include "Student.h"
  #include "Course.h"
  
  class StudentCollection
  {
   private:
    vector&lt;StudentProfile&gt; StCollection;
  
   public:
    void GetInfo();
    void PrintCollection();
    StudentCollection(){};
    StudentCollection(vector&lt;StudentProfile&gt; StCollection){};
  };
  
  #endif
  </code></pre>
  
  <p>It's .cpp file:</p>
  
  <pre><code>#ifndef STUDENTCOLLECTION_CPP
  #define STUDENTCOLLECTION_CPP
  
  #include&lt;iostream&gt;
  #include&lt;fstream&gt;
  #include&lt;vector&gt;
  using namespace std;
  
  #include "StudentCollection.h"
  #include "StudentProfile.h"
  #include "Student.h"
  #include "Person.h"
  #include "Course.h"
  
  void StudentCollection::GetInfo()
  {
    long SN;
    string first;
    string last;
    string a;
    char sex;
    long ID;
    Course Class1;
    Course Class2;
    Course Class3;
    long num;
    string name;
    Person PInfo;
    Student SInfo;
  
    ifstream fin;
    fin.open("info.txt");
  
    fin &gt;&gt; first &gt;&gt; last &gt;&gt; SN &gt;&gt; a &gt;&gt; sex &gt;&gt; ID &gt;&gt; SInfo.Class1.num &gt;&gt; SInfo.Class1.name &gt;&gt; SInfo.Class2.num &gt;&gt; SInfo.Class2.name &gt;&gt; SInfo.Class3.num &gt;&gt; SInfo.Class3.\
  name;
  
  while (!fin.eof())
    {
      StudentProfile New_Stu;
      New_Stu.SetAStudentProfile(PInfo, SInfo);
      New_Stu.PInfo.SetSetAPerson(SN, first, last, a, sex);
      New_Stu.SInfo.SetAStudent(ID, Class1, Class2, Class3);
      New_Stu.SInfo.SetACourse(num, name);
  
      StCollection.push_back(New_Stu);
      fin &gt;&gt; first &gt;&gt; last &gt;&gt; SN &gt;&gt; a &gt;&gt; sex &gt;&gt; ID &gt;&gt; SInfo.Class1.num &gt;&gt; SInfo.Class1.name &gt;&gt; SInfo.Class2.num &gt;&gt; SInfo.Class2.name &gt;&gt; SInfo.Class3.num &gt;&gt; SInfo.Class3.\
  name;
    }
   fin.close();
  }
  
  void StudentCollection::PrintCollection()
  {
  }
  
  #endif
  </code></pre>
  
  <p>StudentProfile.h file:</p>
  
  <pre><code>#ifndef STUDENTPROFILE_H
  #define STUDENTPROFILE_H
  
  using namespace std;
  #include "Person.h"
  #include "Student.h"
  
  class StudentProfile
  {
   private:
    Person PersonalInfo;
    Student StdInfo;
  
   public:
  
    void SetAStudentProfile(Person PInfo, Student SInfo);
    void PrintAStudentProfile();
    StudentProfile(){};
    StudentProfile(Person PInfo, Student SInfo){};
  };
  
  #endif
  </code></pre>
  
  <p>The StudentProfile.cpp:</p>
  
  <pre><code>#ifndef STUDENTPROFILE_CPP
  #define STUDENTPROFILE_CPP
  
  #include&lt;iostream&gt;
  using namespace std;
  
  #include "StudentProfile.h"
  
  void StudentProfile::SetAStudentProfile(Person PInfo, Student SInfo)
  {
    PersonalInfo = PInfo;
    StdInfo = SInfo;
  }
  
  void StudentProfile::PrintAStudentProfile()
  {
  }
  
  #endif
  </code></pre>
  
  <p>This is my edited error (I have another issue with an object elsewhere, but I'm sure the cause is the same):</p>
  
  <pre><code>StudentCollection.cpp:43: error: ‘class StudentProfile’ has no member named ‘PInfo’
  StudentCollection.cpp:44: error: ‘class StudentProfile’ has no member named ‘SInfo’
  StudentCollection.cpp:45: error: ‘class StudentProfile’ has no member named ‘SInfo’
  </code></pre>