Community
cancel
Showing results for 
Search instead for 
Did you mean: 
337 Views

Problem compiling the sample program with the tbb distribution

Jump to solution

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.

-Mitchelle.

0 Kudos
1 Solution
Alexey_K_Intel3
Employee
337 Views
Please check that the release version of the library has been built in linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_release (look there for libtbb.so.2 which is the actual binary and forlibtbb.so which is a linker script). Also it seems you should source the tbbvars.sh from the above release directory to use the release version of TBB needed to build the example with 'make all'.

View solution in original post

6 Replies
TimP
Black Belt
337 Views
Quoting - mrasquinha

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.

-Mitchelle.

The question might be dealt with more rapidly on the TBB forum. If you have downloaded source only, you would need to build that library before you could link against it.

Alexey_K_Intel3
Employee
337 Views
Mitchelle,
could you describe step by stepwhat you did since unpackaging the TBB source tarball? Howyou built TBB, what .sh file you sourced, how you built the example, etc.

337 Views
Mitchelle,
could you describe step by stepwhat you did since unpackaging the TBB source tarball? Howyou built TBB, what .sh file you sourced, how you built the example, etc.

I downloaded the source package "tbb21_20080605oss_src.tgz"

Extracted it set tbb_root and ran a "make all" on the top level directory. I then sourced the "tbbvars.sh" shell script within linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_debug

I have also tried make a link to libtbb_debug.so.2.

The following is the error in trying to compile the example

/examples/GettingStarted/sub_string_finder> make all
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

My gcc version is gcc version 4.2.3 with ubuntu 8.04

Alexey_K_Intel3
Employee
338 Views
Please check that the release version of the library has been built in linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_release (look there for libtbb.so.2 which is the actual binary and forlibtbb.so which is a linker script). Also it seems you should source the tbbvars.sh from the above release directory to use the release version of TBB needed to build the example with 'make all'.

View solution in original post

337 Views
Please check that the release version of the library has been built in linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_release (look there for libtbb.so.2 which is the actual binary and forlibtbb.so which is a linker script). Also it seems you should source the tbbvars.sh from the above release directory to use the release version of TBB needed to build the example with 'make all'.

The tbbvars.sh from the release folder worked. Thanks!

RafSchietekat
Black Belt
337 Views

The tbbvars.sh from the release folder worked. Thanks!

To link with the debug version you would need to specify -ltbb_debug instead of -ltbb.

Reply