The incomplete type error is a bug in the compiler which can be worked around by instantiating std::map before the threadprivate directive. But once you get past that issue GCC 4.7 still doesn't support dynamic initialization of threadprivate variables. This will be supported in GCC 4.8.