相关疑难解决方法(0)

使用boost :: iostreams时找不到警告消息RTTI符号

我使用Boost :: iostreams同时写入我的控制台和文件.当我使用eclipse进行调试时(当然使用gdb),我会收到一条警告,说明我在Boost :: iostreams中使用的某个类没有找到RTTI符号.

这是重现问题的最小代码.

#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;
}
Run Code Online (Sandbox Code Playgroud)

当我TeeStream cool_cout(my_tee);在调试期间越线时,我收到以下警告:

warning: RTTI symbol not found for class …
Run Code Online (Sandbox Code Playgroud)

gdb eclipse-cdt rtti debug-symbols boost-iostreams

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

boost-iostreams ×1

debug-symbols ×1

eclipse-cdt ×1

gdb ×1

rtti ×1