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.