- May 7, 2013
- 10,400
This is a quite a annoying error, supposedly Visual Studio 2012 is designed to support the C++ 11 Standard, and therefore should support the thread_local keyword. However, in my case, it doesn't seem to be supporting thread_local at all.
Error - this declaration has no storage class or type specifier
In the meantime, I simply using the __declspec keyword.
Code:
#include <iostream>
#include <thread>
thread_local int number;
Error - this declaration has no storage class or type specifier
In the meantime, I simply using the __declspec keyword.