Hello 
Actually I was trying to serialize my main code using boost_serialization (this is the small program I have written to extract my actual problem of how to serialize the static int class member variable). Without boost_serialization of static int variable the code is running fine. But when I try to serialize the static int variable in "Public" of linklist class I get the error (segmentation fault). I tried to use the "BOOST_STRONG_TYPEDEF" to wrap the "int" to "tracked_int" but the effort was in vain. Kindly help me. 

regards,
ashish

--- On Wed, 24/3/10, Robert Ramey <ramey@rrsd.com> wrote:

From: Robert Ramey <ramey@rrsd.com>
Subject: Re: [Boost-users] error in boost_serialization of static variable
To: boost-users@lists.boost.org
Date: Wednesday, 24 March, 2010, 9:22 AM

ashish srivastava wrote:
> Hello
> I am having some problem in executing the code of
> boost_serialization. I'm trying to serialize the static class member
> variable. For that purpose I have wrapped the int static variable to
> tracked_int static variable. Please find the code attached with this
> mail.   
>
> This is how I'm running the code and getting the segmentation fault.
> ---------------------------------------------------------
> $ g++ test_serialization_linklist.cpp -l boost_serialization
> $ ./a.out
>  do u want to continue adding more nodes into the link list (y/n) ??y
>  do u want to continue adding more nodes into the link list (y/n) ??y
>  do u want to continue adding more nodes into the link list (y/n) ??n
> 5
> 6
> 6
> 6
>
> the number of nodes present in the list = 4
> Segmentation fault
>
I looked at the program.
 
you save one instance through a pointer
 
 ar & start
 
you load one instance though a pointer
 
ar & newg
 
then you try to loop starting at newg.  This won't work as there is
only one pointer. 
 
Try using std::list rather than your own "list" class.
 
Robert Ramey
 

-----Inline Attachment Follows-----

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users


The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.