Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-01-19 05:13:34

yinglcs2_at_[hidden] wrote:
> I am using gcc 4.0.1 on Fedora 4. I get these error
> messages if I include the Boost smart pointer library
> files:
> /usr/include/boost/detail/shared_count.hpp: In member
> function â?~virtual void*
> boost::detail::sp_counted_base_impl<P,
>>>> get_deleter(const std::type_info&)â?T:
> /usr/include/boost/detail/shared_count.hpp:269: error:
> cannot use typeid with -fno-rtti
> /usr/include/boost/shared_ptr.hpp: In function â?~D*
> boost::get_deleter(const boost::shared_ptr<U>&)â?T:
> /usr/include/boost/shared_ptr.hpp:460: error: cannot
> use typeid with -fno-rtti

shared_ptr only uses typeid(T), where T is a type, so it works on some
compilers with RTTI off. But not on GCC. You need to replace the bodies of
the two functions with 'return 0;' to make it compile. Of course you
wouldn't be able to use get_deleter with this modification, but everything
else should work.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at