title: "Does not name a type" error, even when header file is included
body: <p>Below is the error message I am getting:</p>
  
  <p><a href="https://i.stack.imgur.com/2hyMP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2hyMP.png" alt="enter image description here"></a></p>
  
  <p>This is a "does not name a type error", which usually happens if a header file is not included, or if there is a circular dependency between header files.</p>
  
  <p>Below are the files that are said to have caused the error:</p>
  
  <p>Snippet of <strong>SparseGenRealShiftSolvePardiso.h:</strong></p>
  
  <pre><code>#ifndef SPARSE_GEN_REAL_SHIFT_SOLVE_PARDISO_H
  #define SPARSE_GEN_REAL_SHIFT_SOLVE_PARDISO_H
  
  #include &lt;SolverPardiso.h&gt;
  #include &lt;Eigen/Core&gt;
  #include &lt;Eigen/SparseCore&gt;
  #include &lt;Eigen/SparseLU&gt;
  #include &lt;stdexcept&gt;
  
  namespace Spectra {
  
  
  ///
  /// \ingroup MatOp
  ///
  /// This class defines the shift-solve operation on a sparse real matrix \f$A\f$,
  /// i.e., calculating \f$y=(A-\sigma I)^{-1}x\f$ for any real \f$\sigma\f$ and
  /// vector \f$x\f$. It is mainly used in the GenEigsRealShiftSolverPardiso eigen solver.
  ///
  template &lt;typename Scalar,int Flags = 0, typename StorageIndex = int&gt;
  class SparseGenRealShiftSolvePardiso
  {
  private:
      typedef Eigen::Matrix&lt;Scalar, Eigen::Dynamic, 1&gt; Vector;
      typedef Eigen::Map&lt;const Vector&gt; MapConstVec;
      typedef Eigen::Map&lt;Vector&gt; MapVec;
      typedef Eigen::SparseMatrix&lt;Scalar, Flags, StorageIndex&gt; SparseMatrix;
      typedef const Eigen::Ref&lt;const SparseMatrix&gt; ConstGenericSparseMatrix;
  
      Eigen::SparseMatrix&lt;double,Eigen::RowMajor&gt; m_mat;
      const int m_n;
  //    Eigen::SparseLU&lt;SparseMatrix&gt; m_solver;
  //    SparseMatrix&amp; m_mat;
      mutable SolverPardiso&lt;Eigen::SparseMatrix&lt;double,Eigen::RowMajor&gt; &gt; m_solver; // &lt;&lt; THIS IS THE PROBLEM
  </code></pre>
  
  <p>Snippet of <strong>TimeStepperEigenFitSI.h:</strong></p>
  
  <pre><code>#ifndef TimeStepperEigenFitSI_h
  #define TimeStepperEigenFitSI_h
  
  
  #include &lt;SolverPardiso.h&gt;
  #include &lt;World.h&gt;
  #include &lt;Assembler.h&gt;
  #include &lt;TimeStepper.h&gt;
  #include &lt;Eigen/Dense&gt;
  #include &lt;Eigen/Sparse&gt;
  #include &lt;UtilitiesEigen.h&gt;
  #include &lt;UtilitiesMATLAB.h&gt;
  #include &lt;Eigen/SparseCholesky&gt;
  #include &lt;EigenFit.h&gt;
  #include &lt;limits&gt;
  #include &lt;Eigen/Eigenvalues&gt;
  
  #include &lt;unsupported/Eigen/MatrixFunctions&gt;
  
  #include &lt;math.h&gt;
  #include &lt;algorithm&gt;
  </code></pre>
  
  <p>Snippet of <strong>EigenFit.h:</strong></p>
  
  <pre><code>#ifndef EigenFit_h
  #define EigenFit_h
  
  #include &lt;SolverPardiso.h&gt;
  #include &lt;FEMIncludes.h&gt;
  #include &lt;GaussIncludes.h&gt;
  #include &lt;UtilitiesFEM.h&gt;
  #include &lt;State.h&gt;
  #include &lt;ParticleSystemIncludes.h&gt;
  #include &lt;ConstraintFixedPoint.h&gt;
  #include &lt;unsupported/Eigen/SparseExtra&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;igl/sortrows.h&gt;
  #include &lt;igl/histc.h&gt;
  #include &lt;igl/unique_rows.h&gt;
  #include &lt;igl/hausdorff.h&gt;
  #include &lt;fstream&gt;
  #include &lt;SparseGenRealShiftSolvePardiso.h&gt;
  
  #include &lt;igl/boundary_facets.h&gt;
  #include &lt;resultsUtilities.h&gt;
  </code></pre>
  
  <p>Snippet of <strong>exampleEigenFit.cpp:</strong></p>
  
  <pre><code>#include &lt;functional&gt;
  
  #include &lt;Qt3DIncludes.h&gt;
  #include &lt;GaussIncludes.h&gt;
  #include &lt;FEMIncludes.h&gt;
  
  //Any extra things I need such as constraints
  #include &lt;ConstraintFixedPoint.h&gt;
  #include &lt;TimeStepperEigenFitSI.h&gt;
  #include &lt;resultsUtilities.h&gt;
  #include &lt;EigenFit.h&gt;
  #include &lt;fstream&gt;
  #include &lt;igl/boundary_facets.h&gt;
  #include &lt;igl/volume.h&gt;
  #include &lt;igl/writePLY.h&gt;
  #include &lt;time.h&gt;
  
  #include &lt;fstream&gt;
  #include &lt;vector&gt;
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  </code></pre>
  
  <p>Snippet of <strong>SolverPardiso.h</strong>, which is located in the SolversLinear folder, which as you can see from the compilation order, is compiled first before exampleEigenFit.cpp:</p>
  
  <pre><code>#ifndef SolverPardiso_h // OLD
  #define SolverPardiso_h
  
  // #ifndef SolverPardiso // ADDED
  // #define SolverPardiso // ADDED
  
  #ifdef GAUSS_PARDISO
  
  extern "C" void pardisoinit (void   *, int    *,   int *, int *, double *, int *);
  extern "C" void pardiso     (void   *, int    *,   int *, int *,    int *, int *,
   double *, int    *,    int *, int *,   int *, int *,
   int *, double *, double *, int *, double *);
  extern "C" void pardiso_chkmatrix  (int *, int *, double *, int *, int *, int *);
  extern "C" void pardiso_chkvec     (int *, int *, double *, int *);
  extern "C" void pardiso_printstats (int *, int *, double *, int *, int *, int *,
   double *, int *);
  
  
  #include &lt;cstdio&gt;
  #include &lt;cstdlib&gt;
  #include &lt;cmath&gt;
  
  template&lt;typename MatrixType&gt;
  class SolverPardiso
  {
  public:
  protected:
  private:
  };
  
  template &lt;&gt;
  class SolverPardiso&lt;Eigen::SparseMatrix&lt;double, Eigen::RowMajor&gt; &gt;
  {
  public:
  
      using SparseMatrix = Eigen::SparseMatrix&lt;double, Eigen::RowMajor&gt;;
  
      //Pardiso stuff
      //default matrix type = unsymmetric
      //only the upper triangle of symmetric matrices must be passed to pardiso 
      SolverPardiso(int matrixType = 11, unsigned int numProcessors = 8) {
  
          m_matrixType = matrixType;
  
          //Annoying license file stuff
          int error = 0;
          int solver = 0; /* use sparse direct solver */
          pardisoinit (m_ptr,  &amp;m_matrixType, &amp;solver, m_integerParams, m_doubleParams, &amp;error);
  
          if (error != 0)
          {
              if (error == -10 )
                  printf("No license file found \n");
              if (error == -11 )
                  printf("License is expired \n");
              if (error == -12 )
                  printf("Wrong username or hostname \n");
              exit(0);
          }
          else
              printf("[PARDISO]: License check was successful ... \n");
  
          //Number of Processors
          m_integerParams[2] = numProcessors;
          m_maxfct = 1; //perform at most one factorization
          m_mnum = 1; // use factorization 1
          m_nrhs = 1; //1 right hand side for now
          m_displayStats = 0;
  
      }
  </code></pre>
  
  <p>Firstly, the header file SolverPardiso.h is included in SparseGenRealShiftSolvePardiso.h, so that rules out the header file not being included, and based on the header file SolverPardiso.h, it looks like only primitive header files are being called, so I don't see how there could be a circular dependency.</p>
  
  <p>I apologize if the code is a bit long and complicated. But I have been stuck on this for a while.</p>
  
  <p>Thank you.</p>