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)
Warnings you should be concerned about are from the compiler, which is what actually creates your program. End users should not be using a debugger, and it has no impact on your binary itself.
While gdb sometimes finds issues, many of the warnings in it are because gdb consumes debug symbols, and the consumer (gdb) has bugs and defencencies . Often they just reduce the functionality of gdb. In this case there is less information about that class available inside the debugger. It makes debugging more difficult, but doesn't hurt the application itself.
You have several choices for what to do about this error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With