
Just started experimenting with the serialization library. I started by writing a small example very much like that shown in the tutorial. I created a simple class to serialize containing two unsigned int vars and an std::string This is close to what I would need to do once I move beyond familiarizing myself with the use of the library. When I compile I get errors in the boost code: s-test.h:49: instantiated from here /usr/include/boost/archive/detail/oserializer.hpp:567: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' make: *** [stest] Error 1 When I look at boost static assert I find this: #define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\ BOOST_JOIN(boost_static_assert_typedef_, __LINE__) #endif Which I believe is macro expansion sizeof that is being complained about. I'm using boost 1_35_0 (release tarball), gcc 4.1.2, Fedora 7. Looking for hints as to where to go from here. Thanks, -dwh- -- I not only live each endless day in grief, but live each day thinking about living each day in grief. -- C. S. Lewis ------------------------------------------------------------ Daniel W. Hinz Xerox Corp;XOG/SEEDU MS: 801-17A e-mail: dan.hinz@xerox.com 1350 Jefferson Road TEL: 585.422.8078 Rochester, NY 14623

Maybe it would better, if you write your code.. Daniel Hinz schrieb:
Just started experimenting with the serialization library. I started by writing a small example very much like that shown in the tutorial. I created a simple class to serialize containing two unsigned int vars and an std::string This is close to what I would need to do once I move beyond familiarizing myself with the use of the library.
When I compile I get errors in the boost code:
s-test.h:49: instantiated from here /usr/include/boost/archive/detail/oserializer.hpp:567: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' make: *** [stest] Error 1
When I look at boost static assert I find this:
#define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\ BOOST_JOIN(boost_static_assert_typedef_, __LINE__) #endif
Which I believe is macro expansion sizeof that is being complained about.
I'm using boost 1_35_0 (release tarball), gcc 4.1.2, Fedora 7.
Looking for hints as to where to go from here.
Thanks, -dwh-

check the rationale section regarding the saving of non-const data sets. Robert Ramey Daniel Hinz wrote:
Just started experimenting with the serialization library. I started by writing a small example very much like that shown in the tutorial. I created a simple class to serialize containing two unsigned int vars and an std::string This is close to what I would need to do once I move beyond familiarizing myself with the use of the library.
When I compile I get errors in the boost code:
s-test.h:49: instantiated from here /usr/include/boost/archive/detail/oserializer.hpp:567: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' make: *** [stest] Error 1
When I look at boost static assert I find this:
#define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\ BOOST_JOIN(boost_static_assert_typedef_, __LINE__) #endif
Which I believe is macro expansion sizeof that is being complained about.
I'm using boost 1_35_0 (release tarball), gcc 4.1.2, Fedora 7.
Looking for hints as to where to go from here.
Thanks, -dwh-

Robert Ramey wrote:
check the rationale section regarding the saving of non-const data sets.
Robert Ramey
Daniel Hinz wrote:
Just started experimenting with the serialization library. I started by writing a small example very much like that shown in the tutorial. I created a simple class to serialize containing two unsigned int vars and an std::string This is close to what I would need to do once I move beyond familiarizing myself with the use of the library.
When I compile I get errors in the boost code:
s-test.h:49: instantiated from here /usr/include/boost/archive/detail/oserializer.hpp:567: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' make: *** [stest] Error 1
When I look at boost static assert I find this:
#define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\ BOOST_JOIN(boost_static_assert_typedef_, __LINE__) #endif
Which I believe is macro expansion sizeof that is being complained about.
Daniel, What Robert failed to mention is that the whole **purpose** of BOOST_STATIC_ASSERT is to cause a compilation error using sizeof when some condition is violated. I sure wish people would stop using BOOST_STATIC_ASSERT in favor of one of the MPL_ASSERT macros, because the error messages are so much better and would lead to less confusion and easier support. -- Dave Abrahams BoostPro Computing http://www.boostpro.com

Thank you. I don't understand all of that explanation but enough that my test programs are successfully running. On a related note, there is a rather inconvenient piece of misinformation in the rationale. It refers often to BOOST_SERIALIZATION_TRACKING. However, it appears that what it should say is BOOST_CLASS_TRACKING. It actually does say that elsewhere. I've not been around long and have not used the ticket system but there appears to be no category for documentation issues. For other readers it would be nice to get this corrected, that is if I know what I'm saying. Suggestions? -dwh- On Friday 20 June 2008 03:09:26 am Robert Ramey wrote:
check the rationale section regarding the saving of non-const data sets.
Robert Ramey
Daniel Hinz wrote:
Just started experimenting with the serialization library. I started by writing a small example very much like that shown in the tutorial. I created a simple class to serialize containing two unsigned int vars and an std::string This is close to what I would need to do once I move beyond familiarizing myself with the use of the library.
When I compile I get errors in the boost code:
s-test.h:49: instantiated from here /usr/include/boost/archive/detail/oserializer.hpp:567: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' make: *** [stest] Error 1
When I look at boost static assert I find this:
#define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\ BOOST_JOIN(boost_static_assert_typedef_, __LINE__) #endif
Which I believe is macro expansion sizeof that is being complained about.
I'm using boost 1_35_0 (release tarball), gcc 4.1.2, Fedora 7.
Looking for hints as to where to go from here.
Thanks, -dwh-
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- I not only live each endless day in grief, but live each day thinking about living each day in grief. -- C. S. Lewis ------------------------------------------------------------ Daniel W. Hinz Xerox Corp;XOG/SEEDU MS: 801-17A e-mail: dan.hinz@xerox.com 1350 Jefferson Road TEL: 585.422.8078 Rochester, NY 14623

Daniel Hinz wrote:
Just started experimenting with the serialization library. I started by writing a small example very much like that shown in the tutorial. I created a simple class to serialize containing two unsigned int vars and an std::string This is close to what I would need to do once I move beyond familiarizing myself with the use of the library.
You should really read the tutorial from beginning and beter don't try to subclass or use polymorphic pointers until you read the section explaining it.
When I compile I get errors in the boost code:
s-test.h:49: instantiated from here /usr/include/boost/archive/detail/oserializer.hpp:567: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' make: *** [stest] Error 1
Thats an error triggered intentional to show that you have done something wrong. Best you have a look at the tutorial again and if you don't manage to get it right you need to post (a short version of) your example program here in order to help you. Yours sincerely Markus Raab
participants (6)
-
Daniel Hinz
-
Daniel Hinz
-
David Abrahams
-
Hansi
-
Markus Raab
-
Robert Ramey