smtk fails to compile with gcc-4.9.4 & gcc-4.8.5 due to Archive.cxx - iostream
Hi All,
SMTK fails to compile with gcc-4.9.4 due to an issue with iostreams in Archive.cxx:
[1/81] Building CXX object smtk/CMakeFiles/smtkCore.dir/common/Archive.cxx.o
FAILED: smtk/CMakeFiles/smtkCore.dir/common/Archive.cxx.o
/opt/jenkins/jenkins-tools/gcc-4.9.4/bin/g++ -DBOOST_ALL_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DSMTK_PYTHON_ENABLED -DsmtkCore_EXPORTS -I. -I/opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src -isystem /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/thirdparty -isystem thirdparty -isystem /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/thirdparty/pugixml -isystem /opt/jenkins/workspace/corey/new_sb/_build1/install/include -isystem /opt/jenkins/workspace/corey/new_sb/_build1/install/include/python2.7 -fPIC -std=c++11 -O3 -DNDEBUG -fPIC -fvisibility=hidden -pthread -std=gnu++11 -MD -MT smtk/CMakeFiles/smtkCore.dir/common/Archive.cxx.o -MF smtk/CMakeFiles/smtkCore.dir/common/Archive.cxx.o.d -o smtk/CMakeFiles/smtkCore.dir/common/Archive.cxx.o -c /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx
/opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx: In member function ‘std::ifstream smtk::common::Archive::get(const string&)’:
/opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:369:42: error: use of deleted function ‘std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)’
return std::ifstream(filepath->second);
^
In file included from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17:0,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:430:11: note: ‘std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:430:11: error: use of deleted function ‘std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)’
In file included from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:38:0,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/istream:58:11: note: ‘std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/istream:58:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
In file included from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/ios:44:0,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/istream:38,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:38,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/bits/basic_ios.h:66:11: note: ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_ios : public ios_base
^
In file included from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/ios:42:0,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/istream:38,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:38,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/bits/ios_base.h:786:5: error: ‘std::ios_base::ios_base(const std::ios_base&)’ is private
ios_base(const ios_base&);
^
In file included from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/ios:44:0,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/istream:38,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:38,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/bits/basic_ios.h:66:11: error: within this context
class basic_ios : public ios_base
^
In file included from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17:0,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:430:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:430:11: error: use of deleted function ‘std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)’
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:72:11: note: ‘std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
^
In file included from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/ios:43:0,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/istream:38,
from /opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:38,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/streambuf:802:7: error: ‘std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ is private
basic_streambuf(const basic_streambuf& __sb)
^
In file included from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.h:17:0,
from /opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:10:
/opt/jenkins/jenkins-tools/gcc-4.9.4/include/c++/4.9.4/fstream:72:11: error: within this context
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
^
/opt/jenkins/workspace/corey/new_sb/_build1/superbuild/smtk/src/smtk/common/Archive.cxx:373:24: error: use of deleted function ‘std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)’
return std::ifstream();
^
ninja: build stopped: subcommand failed.
The problem is moving iostreams was not supported until GCC 5.1:
Edited by chart3388