I use Boost::iostreams to write simultaneously to my console and a file. When i use eclipse to debug(with gdb of course), i receive a warning which says RTTI symbol not found for one of the classes that i am using from Boost::iostreams.
Here is the minimal code to reproduce the problem.
#ifndef BOOST_IO_STREAM_H_
#define BOOST_IO_STREAM_H_
#include <fstream>
#include <boost/iostreams/tee.hpp>
#include <boost/iostreams/stream.hpp>
using boost::iostreams::tee_device;
using boost::iostreams::stream;
typedef tee_device<std::ostream, std::ofstream> TeeDevice;
typedef stream<TeeDevice> TeeStream;
#endif /* BOOST_IO_STREAM_H_ */
int
main()
{
/* A config file to output experiment details */
std::string self_filename = "./experimentconfig.txt";
std::ofstream fconfig(self_filename.c_str());
TeeDevice my_tee(std::cout, fconfig);
TeeStream cool_cout(my_tee);
cool_cout << "Output to file and console during experiment run" << std::endl;
return 0;
}
When i cross the TeeStream cool_cout(my_tee);
line during debugging, i receive the below warnings:
warning: RTTI symbol not found for class 'boost::iostreams::stream<boost::iostreams::tee_device<std::ostream, std::basic_ofstream<char, std::char_traits<char> > >, std::char_traits<char>, std::allocator<char> >'
warning: RTTI symbol not found for class 'boost::iostreams::stream_buffer<boost::iostreams::tee_device<std::ostream, std::basic_ofstream<char, std::char_traits<char> > >, std::char_traits<char>, std::allocator<char>, boost::iostreams::output>'
The warnings are repeated whenever the object cool_cout is encountered. How do i fix this? Of course, the programs which use this code works and i have no issues with that. Warnings are not supposed to be ignored and there is some knowledge out there about RTTI symbols which has to be gained. (I cannot compile with -f nortti then the executable complains that rtti should definitely be enabled to use iostreams)