Freigeben über


Compilerfehler C3058

"Symbol": Das Symbol kann erst als "threadprivate" deklariert werden, wenn es in der copyin-Klausel verwendet wird.

Ein Symbol muss zunächst als threadprivate deklariert werden, bevor es in einer copyin -Klausel verwendet werden kann.

Im folgenden Beispiel wird C3058 generiert:

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

void test() {
   #pragma omp parallel copyin(x, y)   // C3058
   {
   }
}

Mögliche Lösung:

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

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