When compiling STLport with the standard Android NDK (version R4), there is an incompatibility with Boost shared_ptr (see my blog article on this subject http://www.codexperiments.com/android/2010/05/android-introduction-part-2-setting-up-your-environment/\) and STLPort because STLPort does not define bad_alloc class when _STLP_USE_EXCEPTIONS flag is turned on. However, even when not using exceptions handling (try catch) as this is not authorized on defualt Android NDK, exceptions class should be available to allow emulation and avoid incompatibilities with exception-able code.
Here is the problematic Boost code:
in shared_count.hpp: "boost::throw_exception( std::bad_alloc() );"
And here is the error:
./../../../cots/boost/boost/smart_ptr/detail/shared_count.hpp: In constructor 'boost::detail::shared_count::shared_count(Y*)':
./../../../cots/boost/boost/smart_ptr/detail/shared_count.hpp:102: error: 'bad_alloc' is not a member of 'std'
I provide a patch which shouldn't have any side-effects on other platforms. However, as this is the first time I try a modification on STLPort and my knowledge of it is limited, please review it carefully. There may be a better way.
Log in to post a comment.