Boost compile error on converting UUID to string using boost::lexical_cast
问题 I have this code which is based on several posts in SO: boost::uuids::uuid uuid = boost::uuids::random_generator()(); auto uuidString= boost::lexical_cast<std::string>(uuid); but when I am compiling this code, I am getting this error: Source type is neither std::ostream`able nor std::wostream`able C:\Local\boost\boost\lexical_cast\detail\converter_lexical.hpp How can I fix this error? 回答1: You're missing the include, I guess: Live On Coliru #include <boost/lexical_cast.hpp> #include <boost