Freigeben über


Compilerfehler C3055

'Symbol': Auf das Symbol kann erst verwiesen werden, wenn es in der threadprivate-Direktive verwendet wird.

Es wurde auf ein Symbol verwiesen und dieses dann in einer threadprivate -Klausel verwendet. Dies ist nicht zulässig.

Im folgenden Beispiel wird C3055 generiert:

// C3055.cpp
// compile with: /openmp
int x, y;
int z = x;
#pragma omp threadprivate(x, y)   // C3055

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

Mögliche Lösung:

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

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