スレッドビルディングブロック(http://threadingbuildingblocks.org/ver.php?fid=174)をディレクトリ/ home / is_admin /tbb40_233oss/のcentosにインストールします
これは私のコードです:
#include "tbb/concurrent_queue.h"
#include <iostream>
using namespace std;
using namespace tbb;
int main() {
concurrent_queue<int> queue;
for( int i=0; i<10; ++i )
queue.push(i);
for( concurrent_queue<int>::const_iterator i(queue.begin());
i!=queue.end(); ++i )
cout << *i << " ";
cout << endl;
return 0;
}
このコマンドを使用してコードをコンパイルします。
g++ test_concurrent_queue.cpp -I/home/is_admin/tbb40_233od/linux_intel64_gcc_cc4.1.2_libc2.5_kernel2.6.18_release -ltbb -o tcq
しかし、それはこのエラーを与えます:
class tbb::strict_ppl::concurrent_queue<int, tbb::cache_aligned_allocator<int> > has no member named begin
class tbb::strict_ppl::concurrent_queue<int, tbb::cache_aligned_allocator<int> > has no member named end
理由がわかりませんか?tbbの経験がある人は誰でも私を助けることができますか?