установить пронизывающие строительные блоки (http://threadingbuildingblocks.org/ver.php?fid=174) в CentOS в каталоге/дома/is_admin/tbb40_233oss /Почему эта программа tbb не может скомпилировать?
Это мой код:
#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
Я не могу понять, почему? Кто-нибудь может мне помочь?
ли вы имеете в виду, я должен использовать concurrent_bounded_queue Код образец код threadingbuildingblocks.org HTTP: // cache-www.intel.com/cd/00/00/30/11/301114_301114.pdf#page=61 – Treper
Хм, я, возможно, что-то пропустил. Ответ, который я дал, был для 'tbb :: strict_ppl :: concurrent_queue', что означает ваш компилятор' concurrent_queue'. Похоже, есть еще один класс 'concurrent_queue' с другим интерфейсом. –
@Greper: Документ, с которым вы связываетесь, находится с 2007 года. Существует более новая документация [здесь] (http://threadingbuildingblocks.org/documentation.php). –