Compiler Error C3035
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 C3035.
OpenMP 'ordered' directive must bind directly to a 'for' or 'parallel for' directive with the 'ordered' clause
An ordered clause was ill formed.
The following sample generates C3035:
// C3035.cpp
// compile with: /openmp /link vcomps.lib
int main() {
int n = 0, x, i;
#pragma omp parallel private(n)
{
#pragma omp ordered // C3035
// Try the following line instead:
// #pragma omp for ordered
for (i = 0 ; i < 10 ; ++i)
;
}
}
Show: