If you include #include <sstream> then you must also reference the class by: std::stringstream or declare using namespace std; before using it.