При написании
#include и попытке компиляции появляется следующее сообщение:
/usr/include/c++/4.5/bits/ios_base.h: In copy constructor ‘std::basic_ios::basic_ios(const std::basic_ios&)’:
/usr/include/c++/4.5/bits/ios_base.h:785:5: error: ‘std::ios_base::ios_base(const std::ios_base&)’ is private
/usr/include/c++/4.5/iosfwd:77:11: error: within this context
/usr/include/c++/4.5/iosfwd: In copy constructor ‘std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)’:
/usr/include/c++/4.5/iosfwd:111:11: note: synthesized method ‘std::basic_ios::basic_ios(const std::basic_ios&)’ first required here
/usr/include/c++/4.5/streambuf: In copy constructor ‘std::basic_filebuf::basic_filebuf(const std::basic_filebuf&)’:
/usr/include/c++/4.5/streambuf:773:7: error: ‘std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>::__streambuf_type&) [with _CharT = char, _Traits = std::char_traits, std::basic_streambuf<_CharT, _Traits>::__streambuf_type = std::basic_streambuf]’ is private
/usr/include/c++/4.5/iosfwd:108:11: error: within this context
/usr/include/c++/4.5/iosfwd: In copy constructor ‘std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)’:
/usr/include/c++/4.5/iosfwd:111:11: note: synthesized method ‘std::basic_filebuf::basic_filebuf(const std::basic_filebuf&)’ first required here
main.cpp: In function ‘int main(int, char**)’:
main.cpp:27:54: note: synthesized method ‘std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)’ first required here
main.cpp:27:54: error: initializing argument 1 of ‘void Replace::replace_strings(std::ifstream, std::ofstream, std::string, std::string)’
make: *** [main.o] Error 1
если убираю этот Include — выводятся сообщения вида error: variable ‘std::ifstream fin’ has initializer but incomplete type, что, собственно, очевидно
$g++ --version
g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Как мне избавиться от этой ошибки?
Вопрос задан
более трёх лет назад
6835 просмотров