
Hi there I'm experiencing a strange compilation error that I cannot resolve myself. The following non-functionating triggers the error. I'm using VC2003 SP1. The error is due to the write() call. template <class T > void sent( const T& object ) { std::ostringstream archive_stream; boost::archive::binary_oarchive archive( archive_stream ); archive & object; std::string outbound_data = archive_stream.str(); // Format the header. std::ostringstream header_stream; header_stream << std::setw( 8 ) << std::hex << outbound_data.size(); std::string outbound_header = header_stream.str(); // Write the serialized data to the socket. We use "gather-write" to send // both the header and the data in a single write operation. std::vector<boost::asio::const_buffer> buffers; buffers.push_back(boost::asio::buffer(outbound_header)); buffers.push_back(boost::asio::buffer(outbound_data)); boost::asio::write( socket, buffers ); } This is the verbose error message: ..\..\..\External\Includes\Boost\asio\impl\write.ipp(40) : error C2825: 'Sync_Write_Stream::error_type': cannot form a qualified name ..\..\..\External\Includes\Boost\asio\impl\write.ipp(58) : see reference to function template instantiation 'size_t boost::asio::write<Sync_Write_Stream,Const_Buffers,boost::asio::detail::transfer_all_t,boost::asio::detail::throw_error_t>(Sync_Write_Stream (__stdcall &),const Const_Buffers &,Completion_Condition,Error_Handler)' being compiled with [ Sync_Write_Stream=SOCKET (int,int,int), Const_Buffers=std::vector<boost::asio::const_buffer>, Completion_Condition=boost::asio::detail::transfer_all_t, Error_Handler=boost::asio::detail::throw_error_t ] SendImages.cpp(75) : see reference to function template instantiation 'size_t boost::asio::write<SOCKET(int,int,int),std::vector<_Ty>>(Sync_Write_Stream (__stdcall &),const Const_Buffers &)' being compiled with [ _Ty=boost::asio::const_buffer, Sync_Write_Stream=SOCKET (int,int,int), Const_Buffers=std::vector<boost::asio::const_buffer> ] ..\..\..\External\Includes\Boost\asio\impl\write.ipp(40) : error C2039: 'error_type' : is not a member of 'operator``global namespace''' ..\..\..\External\Includes\Boost\asio\impl\write.ipp(40) : error C2146: syntax error : missing ';' before identifier 'e' ..\..\..\External\Includes\Boost\asio\impl\write.ipp(40) : error C2065: 'e' : undeclared identifier ..\..\..\External\Includes\Boost\asio\impl\write.ipp(41) : error C2228: left of '.write_some' must have class/struct/union type type is '__w64 unsigned int (__stdcall &)(int,int,int)' ..\..\..\External\Includes\Boost\asio\impl\write.ipp(41) : error C3861: 'e': identifier not found, even with argument-dependent lookup ..\..\..\External\Includes\Boost\asio\impl\write.ipp(44) : error C3861: 'e': identifier not found, even with argument-dependent lookup ..\..\..\External\Includes\Boost\asio\impl\write.ipp(46) : error C3861: 'e': identifier not found, even with argument-dependent lookup ..\..\..\External\Includes\Boost\asio\impl\write.ipp(50) : error C2825: 'Sync_Write_Stream::error_type': cannot form a qualified name ..\..\..\External\Includes\Boost\asio\impl\write.ipp(50) : error C2039: 'error_type' : is not a member of 'operator``global namespace''' ..\..\..\External\Includes\Boost\asio\impl\write.ipp(50) : error C2146: syntax error : missing ';' before identifier 'e' ..\..\..\External\Includes\Boost\asio\impl\write.ipp(50) : error C3861: 'e': identifier not found, even with argument-dependent lookup ..\..\..\External\Includes\Boost\asio\impl\write.ipp(51) : error C3861: 'e': identifier not found, even with argument-dependent lookup Thanks ahead, Christian