我正在使用: gcc --version gcc (Ubuntu 4.9.2-0ubuntu1~14.04) 4.9.2
我正在尝试编译以下程序:
#include <iostream>
#include <cilk/cilk.h>
using namespace std;
int main(){
cout << "\nStart\n";
cilk_for (int i = 0; i < 10; i++) {
cout << "I = " << i;
}
}
但是得到以下错误:
g++ -fcilkplus Cilk_1.cpp
Cilk_1.cpp: In function ‘int main()’:
Cilk_1.cpp:9:12: error: expected primary-expression before ‘int’
cilk_for (int i = 0; i < 10; i++) {
^
Cilk_1.cpp:9:23: error: ‘i’ was not declared in this scope
cilk_for (int i = 0; i < 10; i++) {
^
怎么了 ?
谢谢