title: C++ class has no member named 'blah'
body: <p>I have a .h file with this in it:</p>
  <pre><code>#ifndef CS240_LINKED_LIST_H
  #define CS240_LINKED_LIST_H
  
  #include &lt;string&gt;
  
  //! LLNode implements a doubly-linked list node
  class LLNode {
          friend class LinkedList;
      public:
      
          LLNode(const std::string &amp; v, LLNode * p, LLNode * n) :
            value(v), prev(p), next(n)
          {
          }
      
      private:
          std::string value;        //!&lt; value stored in the node
          LLNode * prev;            //!&lt; pointer to previous node in the list
          LLNode * next;            //!&lt; pointer to next node in the list
  };
  
  
  //! LinkedList implements a doubly-linked list
  class LinkedList
  {
      public:
      
          //!  No-arg constructor.  Initializes an empty linked list
          LinkedList();
      
      
          //!  Copy constructor.  Makes a complete copy of its argument
          LinkedList(const LinkedList &amp; other);
      
      private:
          //!  two dummy nodes to keep track of the beginning and end of the list.
          LLnode beginning;
          LLnode end;
          int size;
  };
  
  #endif
  </code></pre>
  <p>In a cpp file I have:</p>
  <pre><code>#include &quot;LinkedList.h&quot;
  
  LinkedList::LinkedList(){
      this-&gt;beginning.prev = NULL;
      this-&gt;beginning.next = this-&gt;end;
      this-&gt;end.prev = this-&gt;beginning;
      this-&gt;end.next = NULL;
  }
  </code></pre>
  <p>Here's the output:</p>
  <pre><code>&gt;g++ -o LinkedList.o LinkedList.cpp
  In file included from LinkedList.cpp:1:
  LinkedList.h:37: error: 'LLnode' does not name a type
  LinkedList.h:38: error: 'LLnode' does not name a type
  LinkedList.cpp: In constructor 'LinkedList::LinkedList()':
  LinkedList.cpp:4: error: 'class LinkedList' has no member named 'beginning'
  LinkedList.cpp:5: error: 'class LinkedList' has no member named 'beginning'
  LinkedList.cpp:5: error: 'class LinkedList' has no member named 'end'
  LinkedList.cpp:6: error: 'class LinkedList' has no member named 'end'
  LinkedList.cpp:6: error: 'class LinkedList' has no member named 'beginning'
  LinkedList.cpp:7: error: 'class LinkedList' has no member named 'end'
  </code></pre>
  <p>I don't know how to fix this. How else would I set the beginning and end objects? Just so you know, I'm a Java programmer learning C++.</p>