Compiler Error C3044
'section' : only allowed directly nested under an OpenMP 'sections' directive
The compiler found a section
directive was used incorrectly. For more information, see sections.
The following sample generates C3044:
// C3044.cpp
// compile with: /openmp /c
#include "omp.h"
int main() {
int n2 = 2, n3 = 3;
#pragma omp parallel
{
++n2;
#pragma omp sections
{
++n2;
}
#pragma omp section // C3044
{
++n3;
}
}
#pragma omp parallel
{
++n2;
#pragma omp sections
{
#pragma omp section // OK
{
++n3;
}
}
}
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for