Boost :: iostreams를 사용하여 내 콘솔과 파일에 동시에 쓸 수 있습니다. 내가 이클립스 (물론 gdb로) 디버깅을 사용할 때, 나는 Boost :: iostreams에서 사용하고있는 클래스 중 하나에 대해 RTTI 심볼을 찾을 수 없다는 경고를 받는다.경고 메시지 boost :: iostreams를 사용할 때 RTTI 기호를 찾을 수 없습니다.
다음은 문제를 재현하는 데 필요한 최소 코드입니다.
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>'
cool_cout 오브젝트가 발견 될 때마다 경고가 반복된다 : 나는 디버깅시 TeeStream cool_cout(my_tee);
라인을 교차 할 때
#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;
}
, 난 다음 경고를 받는다. 이 문제를 어떻게 해결할 수 있습니까? 물론,이 코드를 사용하는 프로그램은 작동하며 그것에 문제가 없습니다. 경고는 무시되어서는 안되며 얻을 수있는 RTTI 기호에 대한 지식이 있습니다. (나는 -f nortitude로 컴파일 할 수 없다. 그렇기 때문에 실행 파일은 iostream을 사용하기 위해 반드시 활성화되어야한다.)
답장을 보내 주셔서 감사합니다. 나는 choice2와 함께 가고 싶어요. 시간이 충분하다면. 어쨌든 나는 gdb 개발자와 대응할 것이다. 나는 선택의 여지가 없다 4. Boost 라이브러리를 사용하고 템플릿을 사용하지 않는 방법은 무엇입니까? – hAcKnRoCk