Search code examples
c++boost-thread

why is string not declared in scope


I have the following code:

#include <string>
#include <boost/thread/tss.hpp>

static boost::thread_specific_ptr<string> _tssThreadNameSptr;

I get the following error

g++ -c -I$BOOST_PATH tssNaming.h

tssNaming.h:7: error: 'string' was not declared in this scope

But I am including string in my #include.


Solution

  • You have to use std::string since it's in the std namespace.