Boost SmartPointer Library
Hi, Can I use Boost SmartPointer Library without enabling RTTI in the compiler options? If yes, can you please tell how to do that? Thank you. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
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
::get_deleter(const std::type_info&)â:
/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>&)â:
/usr/include/boost/shared_ptr.hpp:460: error: cannot
use typeid with -fno-rtti
--- Peter Dimov
Hi,
Can I use Boost SmartPointer Library without enabling RTTI in the compiler options? If yes, can you
yinglcs2@yahoo.com wrote: please
tell how to do that?
What compiler are you using? _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
yinglcs2@yahoo.com 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
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.
participants (2)
-
Peter Dimov
-
yinglcs2@yahoo.com