c++ - openmp syntax error under VS10 -
i'm trying use simple #pragma omp parallel for under visual studio 10 , error don't understand
here's :
#pragma omp parallel for (int i(0); < size; ++i) { // stuff } and these errors when compiling :
error c2059: syntax error : 'constant' // on for() line error c2059: syntax error : ';' // on for() line error c2143: syntax error : missing ';' before '{' // repeat previous error every { or } in file fatal error c1004: unexpected end-of-file found // on last line of file openmp support activated in compiler options. code compiles , runs fine without openmp instructions.
i tried nest loop in braces :
#pragma omp parallel { (int i(0); < size; ++i) { // stuff } } but compiler tells me expects loop right after #pragma instruction.
does see can doing wrong here ? drives me crazy since have used openmp within same conditions in other programs.
i don't think object style initialisers supported inside for loop control block when openmp active. should rewrite code as:
for (int = 0; < size; ++i) in second case error due fact omp for requires following for loop , not code block.
Comments
Post a Comment