Compiler Error C3005

 

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 C3005.

error_text' : unexpected token encountered on OpenMP 'directive' directive

An OpenMP directive was ill formed.

The following sample generates C3005:

// C3005.c  
// compile with: /openmp  
int main()  
{  
   #pragma omp parallel + for   // C3005  
}  

C3005 can also occur if you put an open brace on the same line as the pragma.

// C3005b.c  
// compile with: /openmp  
int main() {  
   #pragma omp parallel {   // C3005 put open brace on next line  
   lbl2:;  
   }  
   goto lbl2;  
}  

Show: