title: Trying to use a class in one header file in another header file
body: <p>I have a <code>weightedDirectedGraph</code> class and a <code>vertex</code> class in their own header file, weightedDirectedGraph.h. This is it:</p>
  
  <pre><code>#ifndef GRAPH
  #define GRAPH
  
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;list&gt;
  #include "minHeapVertex.h"
  using namespace std;
  
  class vertex
  {
  public:
      string data;
      list&lt;vertex *&gt; neighbors;
      bool known;
      int distance, id;
      vertex * path;
  
      vertex(string x)
      {
          data = x;
      }
  };
  
  class weightedDirectedGraph
  {
  private:
      list&lt;vertex *&gt; vertexList;
      vector&lt;vector&lt;int&gt; &gt; edgeWeights;   //2D vector to store edge weights
      int idCount;
  
      weightedDirectedGraph()
      {
          idCount = 0;
      }
  
      vertex * findVertex(string s);
      void dijkstrasAlg(vertex * s);
  
  public:
      void addVertex(string x);
  
      //adds bi-directional edges
      void addWeightedEdge(string x, string y, int weight);
  };
  
  #endif
  </code></pre>
  
  <p>And I have a <code>minHeapVertex</code> class in a minHeapVertex.h file that will be used as a priority queue in Dijkstra's algorithm. This is the file:</p>
  
  <pre><code>#ifndef MIN_HEAP_VERTEX
  #define MIN_HEAP_VERTEX
  
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include "weightedDirectedGraph.h"
  using namespace std;
  
  class minHeapVertex
  {
  public:
      explicit minHeapVertex(int capacity = 100)
          :heapArray(capacity + 1), currentSize{ 0 } {}
  
      bool isEmpty() const
      {
          return (currentSize == 0);
      }
  
      vertex * getMinVertex() const;  //getting C2143 error here that says I'm missing a semi-colon before '*'. Doesn't make sense though.
      void insert(vertex * insertItem);
      void deleteMin();                   
      vertex * deleteAndReturnMin();      
      void makeEmpty()
      {
          currentSize = 0;
      }
      void decreaseKey(int index, int decreaseValue);
      void remove(int index);
  
  private:
      void buildHeap();
      void percolateDown(int hole);
  
      vector&lt;vertex *&gt; heapArray;
      int currentSize;
  };
  #endif
  </code></pre>
  
  <p>I"m getting a lot of compiling errors (with the first one being a C2143 error on the getMinVertex() declaration) and I think it may have something do with trying to access the <code>vertex</code> class in minHeapVertex.h. Can someone show me what I'm doing wrong? Been at it for hours, tried forward declaring the vertex class, tried removing some of the includes "", looked up the error codes and changed things, but nothing is working and just end up with a bunch of errors.</p>