Try building:
Qt Code:
  1. #include <string>
  2. #include <iostream>
  3.  
  4. int main(void)
  5. {
  6. std::string s("Hello", 5); // This is what Qt does in toStdString()
  7. std::cout << s << std::endl;
  8. return 0;
  9. }
To copy to clipboard, switch view to plain text mode 
If that fails when run then the problem has nothing to do with Qt.