Delen via


Compilerfout C3053

'symbool' : 'threadprivate' is alleen geldig voor globale of statische gegevensitems

Opmerkingen

Symbolen die worden doorgegeven aan threadprivate , moeten globaal of statisch zijn.

Example

In het volgende voorbeeld wordt C3053 gegenereerd:

// C3053.cpp
// compile with: /openmp
void Test() {
   int x, y;
   #pragma omp threadprivate(x, y)   // C3053
   #pragma omp parallel copyin(x, y)
   {
      x = y;
   }
}

Mogelijke oplossing:

// C3053b.cpp
// compile with: /openmp /LD
int x, y;
#pragma omp threadprivate(x, y)

void Test() {
   #pragma omp parallel copyin(x, y)
   {
      x = y;
   }
}