/usr/include/c++/4.2.1/bits/basic_ios.tcc:192: error: base class 'std::ios_base' has private copy constructor
extern template class basic_ios<char>;
^
/usr/include/c++/4.2.1/bits/ostream.tcc:326: error: no matching constructor for initialization of 'basic_ios<char, std::char_traits<char> >'
extern template class basic_ostream<char>;
^~~~~~~~~~~~~
/usr/include/c++/4.2.1/bits/fstream.tcc:892: error: base class 'basic_streambuf<char, std::char_traits<char> >' has private copy constructor
extern template class basic_filebuf<char>;
^
The C++ streams aren't copyable, but they are movable (since C++11). The following compiles with clang++ and LLVM libc++ standard library and runs on my linux just fine: