0

Ubuntu 15.04 で次のコードをテストしようとしています。

#include <iostream>
#include <cilk/cilk.h>

using namespace std;

int main() 
{
    cilk_for(int x=0; x<10; x++) 
    {
        cout << x << endl;
    }
    return 0;
}

次のエラーが表示されます。g++ コマンドは cilk plus を検出できますが、何とかコンパイルできないようです。

anirban@anirban-XPS-8500:~$ g++ test_cilk.cpp -lcilkplus -lcilkrts
test_cilk.cpp: In function ‘int main()’:
test_cilk.cpp:8:11: error: expected primary-expression before ‘int’
  cilk_for(int x=0; x<10; x++) 
           ^
test_cilk.cpp:8:20: error: ‘x’ was not declared in this scope
  cilk_for(int x=0; x<10; x++) 
                    ^
4

1 に答える 1