Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 778 Bytes

compiler-error-c3045.md

File metadata and controls

38 lines (30 loc) · 778 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3045
Compiler Error C3045
11/04/2016
C3045
C3045
9351ba3e-3d3f-455f-ac90-a810fa9fd947

Compiler Error C3045

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;
      }
   }
}