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?
You're missing the include, I guess:
#include <boost/lexical_cast.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/random_generator.hpp>
int main() {
boost::uuids::uuid uuid = boost::uuids::random_generator()();
auto uuidString = boost::lexical_cast<std::string>(uuid);
}