|
Boost Users : |
Subject: Re: [Boost-users] [serialization] linker error with static build of serialization on Mingw gcc 4.4.0
From: Philipp Münzel (mailing-lists_at_[hidden])
Date: 2010-10-17 12:53:10
Philipp Münzel <mailing-lists <at> philippmuenzel.de> writes:
> https://svn.boost.org/trac/boost/ticket/4670
> and
> https://svn.boost.org/trac/boost/ticket/4698
>
> I can view them via google ("View Cached"), but I can't access
> the attached patch.
>
I got a highly appreciated reply off-list with the following
patches that should enable a succefull use with MinGw gcc4.4:
Index: serialization/build/Jamfile.v2
=================================================================
--- serialization/build/Jamfile.v2 (revision 65950)
+++ serialization/build/Jamfile.v2 (working copy)
@@ -10,6 +10,7 @@
: source-location ../src
: requirements
<conditional>@include-spirit
+ <define>BOOST_SERIALIZATION_SOURCE=1
;
SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
Index: boost/archive/impl/archive_serializer_map.ipp
=================================================================
--- boost/archive/impl/archive_serializer_map.ipp (revision 65950)
+++ boost/archive/impl/archive_serializer_map.ipp (working copy)
@@ -26,7 +26,7 @@
# pragma warning(disable : 4511 4512)
#endif
-namespace { // anon
+namespace extra_detail { // anon
template<class Archive>
class map : public basic_serializer_map
{};
@@ -40,7 +40,7 @@
BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool)
archive_serializer_map<Archive>::insert
(const basic_serializer * bs){
return boost::serialization::singleton<
- map<Archive>
+ boost::archive::detail::extra_detail::map<Archive>
>::get_mutable_instance().insert(bs);
}
@@ -48,11 +48,11 @@
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
archive_serializer_map<Archive>::erase
(const basic_serializer * bs){
if(boost::serialization::singleton<
- map<Archive>
+ boost::archive::detail::extra_detail::map<Archive>
>::is_destroyed())
return;
boost::serialization::singleton<
- map<Archive>
+ boost::archive::detail::extra_detail::map<Archive>
>::get_mutable_instance().erase(bs);
}
@@ -62,7 +62,7 @@
const boost::serialization::extended_type_info & eti
) {
return boost::serialization::singleton<
- map<Archive>
+ boost::archive::detail::extra_detail::map<Archive>
>::get_const_instance().find(eti);
}
Index: libs/thread/src/win32/thread.cpp
==================================================================
--- libs/thread/src/win32/thread.cpp (revision 65950)
+++ libs/thread/src/win32/thread.cpp (working copy)
@@ -586,8 +586,11 @@
else
{
detail::thread_data_base* const
current_thread_data(get_or_make_current_thread_data());
- tss_data_node* const
new_node=heap_new<tss_data_node>
(key,func,tss_data,current_thread_data->tss_data);
- current_thread_data->tss_data=new_node;
+ if (current_thread_data)
+ {
+ tss_data_node* const
new_node=heap_new<tss_data_node>
(key,func,tss_data,current_thread_data->tss_data);
+ current_thread_data->tss_data=new_node;
+ }
}
}
}
Index: boost/serialization/collection_size_type.hpp
===================================================================
--- boost/serialization/collection_size_type.hpp (revision 66022)
+++ boost/serialization/collection_size_type.hpp (working copy)
@@ -57,6 +57,6 @@
} } // end namespace boost::serialization
BOOST_CLASS_IMPLEMENTATION(collection_size_type, primitive_type)
-BOOST_IS_BITWISE_SERIALIZABLE(collection_size_type);
+BOOST_IS_BITWISE_SERIALIZABLE(collection_size_type)
#endif //BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP
_________________________________________
Applying the last of these patches breaks my build completely.
With the last patch to collection size type, I get the following
error when bulding boost:
gcc.compile.c++ bin.v2\libs\serialization\build\gcc-mingw-4.4.0\
release\link-static\runtime-link-static\threading-multi\
polymorphic_iarchive.o
In file included from ./boost/archive/detail/iserializer.hpp:81,
from ./boost/archive/polymorphic_iarchive.hpp:33,
from libs\serialization\src\polymorphic_iarchive.cpp:19:
./boost/serialization/collection_size_type.hpp:59:
error: expected constructor, destructor, or type conversion
before '(' token
If I don't apply the last of these patches, I can build, but
keep getting the linker errors in my application.
Philipp
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net