Compiler Error C3029
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 C3029.
symbol' : can only appear once in data-sharing clauses in an OpenMP directive
A symbol was used more than once in one or more clauses in a directive. The symbol can only be used once in the directive.
The following sample generates C3029:
// C3029.cpp
// compile with: /openmp /link vcomps.lib
#include "omp.h"
int g_i;
int main() {
int i, x;
#pragma omp parallel reduction(+ : x, x) // C3029
;
#pragma omp parallel reduction(+ : x) // OK
;
#pragma omp parallel private(x) reduction(+ : x) // C3029
;
#pragma omp parallel reduction(+ : x) // OK
;
}
Show: