Freigeben über


Compilerfehler C3056

'symbol': Das Symbol befindet sich nicht im gleichen Bereich wie die 'threadprivate'-Direktive.

Ein in einer threadprivate -Klausel verwendetes Symbol muss sich im gleichen Bereich wie die threadprivate -Klausel befinden.

Im folgenden Beispiel wird C3056 generiert:

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

Mögliche Lösung:

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