title: Can't pass shared pointer as parameter to function definition?
body: <p>If I place a function declaration with a shared pointer as a parameter and its definition in the header, everything compiles fine, but attempting to separate them into a <code>.hpp</code> and <code>.cpp</code> file causes compilation errors like:</p>
  
  <pre><code>Use of undeclared identifier 'std' //Solved via including &lt;memory&gt; &amp; &lt;cstdint&gt;
  Variable has incomplete type 'void' //Solved via including &lt;memory&gt; &amp; &lt;cstdint&gt;
  Use of undeclared identifier 'uint8_t' //Solved via including &lt;memory&gt; &amp; &lt;cstdint&gt;
  </code></pre>
  
  <h1>For example:</h1>
  
  <p>For this main: <em>main.cpp</em></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "example1.hpp" //Switch out with "example2.hpp"
  
  int main(int argc, const char * argv[]) {
  
      std::shared_ptr&lt;uint8_t&gt; image =  0;
  
      foo(image);
  
      return 0;
  }
  </code></pre>
  
  <h2>This Works:</h2>
  
  <p><em>example1.hpp</em></p>
  
  <pre><code>#ifndef example1_hpp
  #define example1_hpp
  
  #include &lt;stdio.h&gt;
  
      void foo(std::shared_ptr&lt;uint8_t&gt; variable) { }
  
  #endif /* example1_hpp */
  </code></pre>
  
  <h2>This does not work:</h2>
  
  <p><em>example2.cpp</em> </p>
  
  <pre><code>#include "example2.hpp"
  
      void foo(std::shared_ptr&lt;uint8_t&gt; variable) {  }
  </code></pre>
  
  <p><em>example2.hpp</em></p>
  
  <pre><code>#ifndef example2_hpp
  #define example2_hpp
  
  #include &lt;stdio.h&gt;
  
      void foo(std::shared_ptr&lt;uint8_t&gt; variable);
  
  #endif /* example2_hpp */
  </code></pre>
  
  <p>How do I separate the declaration and definition for this function into separate files successfully?</p>