title: In C++'s Eigen library, how do I solve: invalid use of incomplete type ‘const class Eigen::MatrixSquareRootReturnValue<Eigen::Matrix<float, -1, -1> >’
body: <p>I'm using the Eigen library in C++ to obtain the square root of a float square matrix:</p>
  
  <pre><code>  MatrixXf gPrime(QUAD_EKF_NUM_STATES, QUAD_EKF_NUM_STATES);
    gPrime.setIdentity();
  
    auto sqrtG = gPrime.sqrt();
  </code></pre>
  
  <p>when I compile it I got the following error:</p>
  
  <pre><code>.../src/QuadEstimatorEKF.cpp:255:31: error: invalid use of incomplete type ‘const class Eigen::MatrixSquareRootReturnValue&lt;Eigen::Matrix&lt;float, -1, -1&gt; &gt;’
     auto sqrtG = gPrime.sqrt()
                                 ^
  In file included from /.../lib/Eigen/Core:346,
                   from /.../lib/Eigen/Dense:1,
                   from /.../src/QuadEstimatorEKF.h:11,
                   from /.../src/QuadEstimatorEKF.cpp:2:
  /.../lib/Eigen/src/Core/util/ForwardDeclarations.h:286:34: note: declaration of ‘class Eigen::MatrixSquareRootReturnValue&lt;Eigen::Matrix&lt;float, -1, -1&gt; &gt;’
   template&lt;typename Derived&gt; class MatrixSquareRootReturnValue;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>What does 'incomplete type' mean and what should I do to fix it?</p>
  
  <p>I'm using C++ 11 and g++ 8.1.1.</p>