title: C++ std::shared_ptr usage and information
body: <p>I am trying to use <code>std::shared_ptr</code> in my code. I have seen there have been other questions on the subject, but I am still getting a compiler error. Have I got the right version of gcc and setup?</p>
  
  <p>What I have done:</p>
  
  <p>I have tried to compile my code with both headers separately &mdash; <code>&lt;memory&gt;</code> and <code>&lt;tr1/memory&gt;</code> but still get the errors below in both cases.</p>
  
  <p>The version of gcc I am using is</p>
  
  <pre><code>gcc --version
  gcc (GCC) 4.3.2
  </code></pre>
  
  <p>When I include <code>&lt;memory&gt;</code> header I use <code>std::shared_ptr</code> and with the <code>&lt;tr1/memory&gt;</code> header I use <code>std::tr1::shared_ptr</code>? Is this correct?</p>
  
  <p>I have set up the shared_ptr as follows:</p>
  
  <pre><code>std::shared_ptr&lt;A*&gt; ptr_A = shared_ptr( new A() );
  </code></pre>
  
  <p>The error I get is as follows:</p>
  
  <pre><code>src/WH.cxx:156: error: 'shared_ptr' is not a member of 'std'
  src/WH.cxx:162: error: 'shared_ptr' was not declared in this scope
  </code></pre>
  
  <p>when I try the <code>&lt;tr1/memory&gt;</code> header</p>
  
  <pre><code>src/WH.cxx:156: error: 'std::tr1' has not been declared
  src/WH.cxx:162: error: 'shared_ptr' was not declared in this scope
  </code></pre>
  
  <p>Looks like I am not including something correctly. Any ideas?</p>
  
  <p>I know the boost library has <code>shared_ptr</code> but these libraries are not an option for me at the moment.</p>
  
  <p><strong>EDIT:
  Just to add, my compiler options are as follows:
  g++  -O3 -g3 -m32 -fPIC  -Wno-deprecated -pthread -m32
  Am I missing anything?</strong></p>
  
  <p>P.S. Is there any useful literature on the std smart pointers?</p>