title: Simple extension of boost::archive::text_oarchive
body: <p>I am trying to add a member variable to a Boost archive class. Following <a href="http://www.boost.org/doc/libs/1_50_0/libs/serialization/doc/derivation.html" rel="nofollow">this</a>, I came up with:</p>
  
  <pre><code>#include &lt;boost/archive/text_oarchive.hpp&gt;
  #include &lt;boost/archive/text_iarchive.hpp&gt;
  
  #include &lt;fstream&gt;
  
  class MyOArchive : public boost::archive::text_oarchive_impl&lt;MyOArchive&gt;
  {
  public:
      bool MyData;
  
      friend class boost::archive::detail::common_oarchive&lt;MyOArchive&gt;;
      friend class basic_text_oarchive&lt;MyOArchive&gt;;
      //friend class boost::serialization::save_access; // save_access in namespace boost::serialization does not name a type
  
      MyOArchive(std::ostream&amp; os, unsigned int flags = 0) : boost::archive::text_oarchive_impl&lt;MyOArchive&gt;(os, flags) {}
  
  };
  
  class MyClass
  {
  public:
  
  private:
      friend class boost::serialization::access;
  
      double Value;
  
      template&lt;class Archive&gt;
      void serialize(Archive &amp; ar, const unsigned int version)
      {
          ar &amp; Value;
      }
  
  };
  
  
  int main()
  {
      MyClass myClass;
  
      std::ofstream outputStream("test.txt");
      //boost::archive::text_oarchive outputArchive(outputStream);
      MyOArchive outputArchive(outputStream);
      outputArchive &lt;&lt; myClass;
      outputStream.close();
  
      return 0;
  }
  </code></pre>
  
  <p>However, I am getting linker errors:</p>
  
  <p><code>undefined reference to boost::archive::text_oarchive_impl&lt;MyOArchive&gt;::text_oarchive_impl(std::ostream&amp;, unsigned int)</code></p>
  
  <p>Can anyone explain what is going wrong here? I don't need to reimplement any of the functions of the archive, just attach this member <code>MyData</code>.</p>