Code:
#include <iostream>

int main()
{
	std::string str("Hello, world!");
	
	std::cout << str << std::endl;
	
	return 0;
}
If this compiles and runs, you have a different problem. Make sure you're including iostream and possibly the string header string.