Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-27 23:42:31

Jonathan Lennox <lennox_at_[hidden]> writes:

> Is it possible to use boost::shared_ptr<> without RTTI being enabled? I'm
> trying to port some code to the Sharp Zaurus, and its GUI libraries are all
> compiled with the G++ flags -fno-exceptions -fno-rtti. Boost seems to
> support the former flag just fine, but has problems with the latter:
> g++ -g -O2 -Wall -fno-rtti -fno-exceptions -o sipua/main.o -c ../sipua/main.cpp
> In file included from ../libcine/boost/shared_ptr.hpp:27,
> from ../rtplib++/rtptypes.h:8,
> from ../rtplib++/rtpsession.h:14,
> from ../sipua/radio.h:11,
> from ../sipua/main.cpp:18:
> ../libcine/boost/detail/shared_count.hpp: In member function `virtual void*
> boost::detail::sp_counted_base_impl<P, D>::get_deleter(const
> std::type_info&)':
> ../libcine/boost/detail/shared_count.hpp:267: error: cannot use typeid with
> -fno-rtti
> In file included from ../rtplib++/rtptypes.h:8,
> from ../rtplib++/rtpsession.h:14,
> from ../sipua/radio.h:11,
> from ../sipua/main.cpp:18:
> ../libcine/boost/shared_ptr.hpp: In function `D* boost::get_deleter(const
> boost::shared_ptr<U>&)':
> ../libcine/boost/shared_ptr.hpp:431: error: cannot use typeid with -fno-rtti
> What is the typeid call in the get_deleter functions doing?

The documentation tells all.

> Is there any
> way to work around or disable this?

You can comment out the entire get_deleter function, provided you
never try to use it ;^)

Dave Abrahams
Boost Consulting

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