After I declared the variable like this:
#include <thread> namespace thread_space { thread_local int s; } //etc.
I tried to compile my code using 'g ++ -std = C ++ 0x -pthread [sourcefile]'. I get the following error:
example.C:6:8: error: thread-local storage is unsupported for the current target static thread_local int s; ^ 1 error generated.
If I try to compile the same code on Linux with GCC 4.8.1 with the same flags, I get an executable executable. I am using clang-503.0.40 (the one that comes with Xcode 5.1.1) on a MacBook Pro with OSX 10.9.3. Can someone explain to me what I'm doing wrong? Thank!
c ++ 11 xcode clang thread-local-storage macos
pier94 May 21 '14 at 18:26 2014-05-21 18:26
source share