문제

I want to name a critical section in openmp

I names it like this:

#pragma omp critical [RawImageFile]

and I am getting this error:

error C3005: '[' : unexpected token encountered on OpenMP 'critical' directive  

if I use it in this way:

#pragma omp critical RawImageFile

I am getting this error:

error C3005: 'RawImageFile' : unexpected token encountered on OpenMP 'critical' directive   

if I use it in this way:

#pragma omp critical "RawImageFile"

I am getting this error:

 error C3005: 'string' : unexpected token encountered on OpenMP 'critical' directive

What is the correct syntax to name a critical section in opnmp in visual studio 2012?

도움이 되었습니까?

해결책

You should be using round-brackets i.e. #pragma omp critical (RawImageFile) not square-brackets. (The square-brackets in the description in the OpenMP specification are part of the syntax description and mean "optional"; they're not tokens which should be included in your code).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top