Ask Your Question

Errors while building OpenCV 3.0.0 with -D BUILD_TBB flag.

asked 2015-06-26 00:16:08 -0500

updated 2015-06-26 00:37:19 -0500

Originally, I wanted to compile opencv 3.0.0 with TBB support on my Raspberry pi. However, libtbb-dev is not available on official raspbian repository. So, I decided to compile OpenCV 3.0.0 from the source to with -D BUILD_TBB=ON -D WITH_TBB=ON cmake flags. It threw me following errors.

[ 56%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_abs.cpp.o [ 58%] Built target opencv_features2d [ 58%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o ../../lib/ undefined reference to tbb::task_group_context::cancel_group_execution()' ../../lib/ undefined reference totbb::interface5::internal::task_base::destroy(tbb::task&)' ../../lib/ undefined reference to tbb::task_scheduler_init::initialize(int)' ../../lib/ undefined reference totbb::task::note_affinity(unsigned short)' ../../lib/ undefined reference to tbb::internal::handle_perror(int, char const*)' ../../lib/ undefined reference totbb::internal::allocate_child_proxy::allocate(unsigned int) const' ../../lib/ undefined reference to tbb::internal::NFS_Free(void*)' ../../lib/ undefined reference totbb::task_group_context::is_group_execution_cancelled() const' ../../lib/ undefined reference to tbb::internal::throw_exception_v4(tbb::internal::exception_id)' ../../lib/ undefined reference totbb::task_scheduler_init::terminate()' ../../lib/ undefined reference to tbb::task_scheduler_init::initialize(int, unsigned int)' ../../lib/ undefined reference totypeinfo for tbb::task' ../../lib/ undefined reference to tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned int) const' ../../lib/ undefined reference totbb::task_group_context::reset()' ../../lib/ undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const' ../../lib/ undefined reference tovtable for tbb::task' ../../lib/ undefined reference to tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const' ../../lib/ undefined reference totbb::task_group_context::init()' ../../lib/ undefined reference to tbb::internal::NFS_Allocate(unsigned int, unsigned int, void*)' ../../lib/ undefined reference totbb::task_scheduler_init::default_num_threads()' ../../lib/ undefined reference to tbb::internal::get_initial_auto_partitioner_divisor()' ../../lib/ undefined reference totbb::task_group_context::~task_group_context()' ../../lib/ undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned int) const' collect2: error: ld returned 1 exit status

So, I decided to compile OpenCV 2.4.9 with the same cmake flags and it worked fine. To see if it's an Rpi problem or -D BUILD_TBB=ON problem, I decided to compile OpenCV 3.0.0 on my ubuntu 15.04 machine with the same cmake configuration and it threw me the same error. What do I need to do to fix this problem ? Has anyone faced the same problem ? I appreciate the help. Thanks.


I also tried changing tbb source file (in 3rdparty/tbb/CMakeList ... (more)

edit retag flag offensive close merge delete


I am not sure but with TBB it seems that there is two configuation one with dll and another where you build tbb your self I think.

In cmake you have got flag WITH_TBB and and another flag BUILD_TBB. In my configuration I have got only TBB dll so I use with_tbb May be there is same difference on linux

PS I haven't got my configuration so I cannot check which flag I use with TBB DLL on windows 7 opencv 3.0 gold

LBerger gravatar imageLBerger ( 2015-06-26 02:17:01 -0500 )edit

@LBerger You're correct, ie you can make use of already installed libraries (like you mentioned with dll) or you can build a 3rd party library from source at the time of building OpenCV as per I understand and BUILD_TBB is for later option, ie, building on the go as you compile OpenCV.

dastaan90 gravatar imagedastaan90 ( 2015-06-26 03:13:13 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-12-14 01:57:13 -0500

This issue was raised on and solved. (link :

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-06-26 00:16:08 -0500

Seen: 1,786 times

Last updated: Dec 14 '15