This is what I've tried, but I am getting Error: Unknown exception thrown
try{//load std::ifstream stream(arch_name.c_str()); std::cout << ">> " << "Started deserializing " << arch_name << std::endl; boost::archive::binary_iarchive arc(stream); arc & c & matrix; stream.close(); std::cout << ">> " << "Finished deserializing" << std::endl; }catch(std::exception e){ std::cout << "Error: " << e.what() << std::endl; return 1; } This is working well in Linux with gcc. I am using Visual Studio in windows.
Edit
backtrace is showing that basic_binary_iprimitive.hpp is throwing exception on
template<class Archive, class Elem, class Tr> inline void basic_binary_iprimitive<Archive, Elem, Tr>::load_binary( void *address, std::size_t count){ //..... if(scount != s) boost::serialization::throw_exception( archive_exception(archive_exception::input_stream_error) ); Edit
I changed the catch black to catch(boost::archive::archive_exception e) and it printed. input stream error
Is there any miss in virtual what in boost archive exception ?
std::ios::binary. It seems to be required on Windows (otherwise EOL characters are corrupted).