Serialization using Boost.Serialization
<p>I have been trying serialization but every time I got stuck with errors like:-</p>

<pre><code>error: 'class std::vector&lt;int, std::allocator&lt;int&gt; &gt;' has no member named 'serialize'
</code></pre>

<p>here is my source code and serialize method ,knowing I am use boost.serialize</p>

<pre><code>template &lt;class E, class T&gt;
class heap{

    vector&lt;E&gt; * hp;
    int index;//index is pointing to first empty place after the last element
    int maxsize;

    T comp;//comparable object designed to compare the objects

private:
    friend class boost::serialization::access;
    // When the class Archive corresponds to an output archive, the
    // &amp; operator is defined similar to &lt;&lt;.  Likewise, when the class Archive
    // is a type of input archive the &amp; operator is defined similar to &gt;&gt;.
    template&lt;class Archive&gt;
    void serialize(Archive &amp; ar, const unsigned int version)
    {

        ar &amp; hp;
        ar &amp; index;
        ar &amp; maxsize;
        ar &amp; comp;
    }

public:
    //default empty constructor
    heap(){

        hp = new vector&lt;E&gt;(MAX);
        index = 0;
        maxsize = MAX;


    }
.
.
.
.
.
.
}
</code></pre>

<p>then i changed this line  ar &amp; hp; into </p>

<pre><code>for(int i = 0; i &lt; hp-&gt;size(); i++)
   ar &amp; hp-&gt;at(i);
</code></pre>

<p>I got even worse errors like </p>

<pre><code>/../../../../boost/boost_1_48_0/boost/archive/text_oarchive.hpp:100: undefined reference to `boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::text_oarchive_impl(std::ostream&amp;, unsigned int)'
debug/main.o: In function `~text_oarchive_impl':

Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/archive/text_oarchive.hpp:85: undefined reference to `boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::~basic_text_oprimitive()'

Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/archive/text_oarchive.hpp:85: undefined reference to `boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::~basic_text_oprimitive()'
</code></pre>
