Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C3045
Collapse the table of content
Expand the table of content

Compiler Error C3045

Error Message

Expected a compound statement following OpenMP 'sections' directive. Missing '{'

A code block delimited by braces must follow a sections directive.

The following sample generates C3045:

// C3045.cpp
// compile with: /openmp /c
#include "omp.h"

int main() {
   int n2 = 2, n3 = 3;

   #pragma omp parallel
   {
      ++n2;

      #pragma omp sections
         ++n2;   // C3045

      #pragma omp sections   // OK
      {
         ++n3;
      }
   }
}

Community Additions

ADD
Show:
© 2015 Microsoft