Intel® Threading Building Blocks

Problem compiling the sample program with the tbb distribution

I have just downloaded the src package and foolowed the getting strted tutorial but have the following error

g++ -O2 -DNDEBUG -o sub_string_finder sub_string_finder.cpp -ltbb
/usr/bin/ld: cannot find -ltbb
collect2: ld returned 1 exit status
make: *** [release] Error 1

I sourced the .sh file it created and am not sure what i am missing.


VC++ language CLR windows form with TBB? (error C2695)

I meet a question. When I write a TBB program in console mode. It is running normally.But when I write a TBB program in clr windows form(this program is the same code under clr windows form and console mode). The compiler appear in the wrong information(error C2695).

" \Program Files\Intel\TBB\2.1\include\tbb\parallel_for.h(59) : error C2695
function1' overriding virtual function differs from 'function2' only by calling convention".
Where function1 is 'start_for::note_affinity' and function2 is 'tbb::task::note_affinity'.

Link Error 1107

I'm just creating my first TBB enabled app. I got past all of the trivial mistakes, and now I'm getting the following link error:

>C:\Program Files\Intel\TBB\2.0\ia32\vc9\bin\tbb_debug.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x308

I'm using VC9 in debug. I'm linking with the /MDd switch. The only thing I can figure is that I'm using .net for the GUI and the .dll file is incompatible with /clr. Does anyone have a better suggestion? (i.e. one that does not involve relearning MFC and rewriting my whole GUI) TIA

Can use reference pointer of managed code in class of TBB?

I have a problem. I want to use reference pointer(as array^) in parallel_for.

for example:

class ApplyFoo {
char *const my_a;
void operator( )( const blocked_range& r ) const {
char *a = my_a;
for( size_t i=r.begin(); i!=r.end( ); ++i )
ApplyFoo( char a[] ) :my_a(a){}

void ParallelApplyFoo( char a[], size_t n ) {
parallel_for(blocked_range(0,n,YouPickAGrainSize), ApplyFoo(a) );

I want to replace char* with array^. How should I do?


Problem Installing on Linux Redhat

Hello, I am trying to install TBB on a Linux Redhat to do my school project. I downloaded the newest TBB 2.1 for Linux, and tried to compile the provided GettingStarted example by executing the MAKE command in the example directory. But I am getting errors:

sub_string_finder.cpp:32:37: tbb/task_scheduler_init.h: No such file or directory

I am thinking that I am probably not sourcing the correct "tbbvars.csh" file. My system is:

gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)

Linux 2.6.9-67.0.20.

Problem with parallel_for

I downloaded TBB (tbb21_20080605oss) from this site. and use it in VC++2005.
my main code is as follows:
void main(){
parallel_for(blocked_range(0, size0, gainsize0), gene_phantom);
for(int iter=0, iter {

parallel_for(blocked_range(0, size1, gainsize1), frontback_phantom);


parallel_for(blocked_range(0, size2, gainsize2), curve_fit);


}//end of iter


my problem are;

1: the first parallel_for works well for any grainsize

Subscribe to Intel® Threading Building Blocks