Can I use Boost options without RTTI?

I would like to disable RTTI in my project. However, this project uses Boost Program options that themselves depend on Boost Any, which does not support -fno-rtti.

I was wondering if there is some solution for using the Boost Program without RTTI? By defining a macro or not using some functions?

thank

+3


source to share


2 answers


The answer is no. Boost.PO is based on Boost.Any and this dependency cannot be avoided at this time. Boost.Any gives the basic storage structure of Boost.PO, so you can't compile any useful PO part without Any.



+4


source


The answer is "maybe". Some acceleration libraries will work with exceptions disabled - some won't. The same goes for RTTI.

I suggest you check the documentation for the acceleration libraries you are interested in.

For example, Boost.Array will work with disabled exceptions, but Boost.Format will not.



If you get messages like you can't use typeid with -fno-rtti, it will probably be when compiling some part of Boost that requires RTTI. If an error occurs, will tell you which library is (usually).

You can try BOOST_NO_RTTI and BOOST_NO_TYPEID ...

http://www.boost.org/doc/libs/1_46_1/libs/exception/doc/configuration_macros.html

+1


source







All Articles