title: How to use pretty debugging printers to see Eigen objects in QtCreator?
body: <p>I am trying to see the contents of an <strong>Eigen</strong> vector in the <strong>Locals and Expressions</strong> window of the <strong>QtCreator</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/BzZ1A.png" alt="enter image description here"></p>
  
  <p>I see that it is a vector with 10 components:</p>
  
  <p><img src="https://i.stack.imgur.com/a2YeD.png" alt="enter image description here"></p>
  
  <p>but when I click it open I get:</p>
  
  <p><img src="https://i.stack.imgur.com/2vqPi.png" alt="enter image description here"></p>
  
  <p>I tried to use <a href="https://bitbucket.org/eigen/eigen/src/12a658962d4e/debug/gdb/printers.py" rel="nofollow noreferrer">this script to do the trick</a>. I saved it along with an empty <strong>__init__.py</strong> file into folder <strong>~/Scripts/Eigen</strong> and created the <strong>.gdbinit</strong> file:</p>
  
  <pre><code>python
  import sys
  sys.path.insert(0, '/home/martin/Scripts/Eigen')
  from printers import register_eigen_printers
  register_eigen_printers (None)
  end
  </code></pre>
  
  <p>I restarted <strong>QtCreator</strong> and nothing changed. I have checked the <strong>"read .gdbinit at startup"</strong> option in QtCreator settings and still nothing.</p>
  
  <p>What is worrying me is that I know that in the past the viewing of Eigen objects worked <strong>without me meddling with some scripts</strong>.</p>
  
  <p>Please, what am I doing wrong?</p>
  
  <p>I am using:</p>
  
  <p><strong>gcc version 4.8.1</strong> <br>
  <strong>Ubuntu 13.10</strong><br>
  <strong>gdb 7.6.1-ubuntu</strong><br>
  <strong>Qt Creator 3.0.0</strong><br>
  <strong>Based on Qt 5.2.0</strong><br></p>
  
  <p>and I am compiling using these flags:</p>
  
  <pre><code>g++ -c -pipe -gdwarf-4 -fvar-tracking-assignments -g 
      -Wall -W -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>as @ggael suggested, I tried to run the <strong>gdb directly</strong>:</p>
  
  <pre><code>(gdb) run
  Starting program: /home/martin/Projects/TestGrounds/test 
  Traceback (most recent call last):
    File "/usr/lib/debug/usr/lib/i386-linux-gnu/libstdc++.so.6.0.18-gdb.py", line 59, in &lt;module&gt;
      from libstdcxx.v6.printers import register_libstdcxx_printers
  ImportError: No module named 'libstdcxx'
  Traceback (most recent call last):
    File "/usr/lib/debug/usr/lib/i386-linux-gnu/libstdc++.so.6.0.18-gdb.py", line 59, in &lt;module&gt;
      from libstdcxx.v6.printers import register_libstdcxx_printers
  ImportError: No module named 'libstdcxx'
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>(gdb) print vec
  Python Exception &lt;class 'TypeError'&gt; 'map' object is not subscriptable: 
  Python Exception &lt;class 'TypeError'&gt; 'map' object is not subscriptable: 
  $1 = {&lt;Eigen::PlainObjectBase&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt; &gt;&gt; = {&lt;Eigen::MatrixBase&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt; &gt;&gt; = {&lt;Eigen::DenseBase&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt; &gt;&gt; = {&lt;Eigen::internal::special_scalar_op_base&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt;, double, double, false&gt;&gt; = {&lt;Eigen::DenseCoeffsBase&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt;, 3&gt;&gt; = {&lt;Eigen::DenseCoeffsBase&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt;, 1&gt;&gt; = {&lt;Eigen::DenseCoeffsBase&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt;, 0&gt;&gt; = {&lt;Eigen::EigenBase&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt; &gt;&gt; = {&lt;No data fields&gt;}, &lt;No data fields&gt;}, &lt;No data fields&gt;}, &lt;No data fields&gt;}, &lt;No data fields&gt;}, &lt;No data fields&gt;}, &lt;No data fields&gt;}, 
      m_storage = {m_data = 0x804e020, m_rows = 10}}, &lt;No data fields&gt;}
  </code></pre>
  
  <p>Please, could you explain what does this mean? What is <strong>libstdcxx</strong>?</p>