הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Structured block in an OpenMP 'sections' region must be preceded by '#pragma omp section'
Remarks
Any code in a code block introduced by a sections directive must be in a code block introduced by a section directive.
This error is obsolete in Visual Studio 2022 and later versions.
Example
The following example generates C3047:
// C3047.cpp
// compile with: /openmp /c
#include "omp.h"
int main() {
int n2 = 2, n3 = 3;
#pragma omp parallel
{
++n2;
#pragma omp sections
{
#pragma omp section
{
++n3;
}
++n2; // C3047 not enclosed in #pragma omp section
}
}
}