why is string not declared in scope

Jimm picture Jimm · Sep 1, 2012 · Viewed 95.7k times · Source

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.

Answer

Rapptz picture Rapptz · Sep 1, 2012

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