Compiler Error C3053
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C3053.
symbol' : 'threadprivate' is only valid for global or static data items
Symbols passed to threadprivate must either be global or static.
The following sample generates C3053:
// C3053.cpp
// compile with: /openmp
void Test() {
int x, y;
#pragma omp threadprivate(x, y) // C3053
#pragma omp parallel copyin(x, y)
{
x = y;
}
}
Possible resolution:
// C3053b.cpp
// compile with: /openmp /LD
int x, y;
#pragma omp threadprivate(x, y)
void Test() {
#pragma omp parallel copyin(x, y)
{
x = y;
}
}
Show: