Ask Your Question

Revision history [back]

Errors while building OpenCV 3.0.0 with -D BUILD_TBB flag.

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/libopencv_imgproc.so.3.0.0: undefined reference to tbb::task_group_context::cancel_group_execution()' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference totbb::interface5::internal::task_base::destroy(tbb::task&)' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::initialize(int)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task::note_affinity(unsigned short)' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::handle_perror(int, char const*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::internal::allocate_child_proxy::allocate(unsigned int) const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::NFS_Free(void*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::is_group_execution_cancelled() const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::throw_exception_v4(tbb::internal::exception_id)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_scheduler_init::terminate()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::initialize(int, unsigned int)' ../../lib/libopencv_core.so.3.0.0: undefined reference totypeinfo for tbb::task' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned int) const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference totbb::task_group_context::reset()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const' ../../lib/libopencv_core.so.3.0.0: undefined reference tovtable for tbb::task' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::init()' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::NFS_Allocate(unsigned int, unsigned int, void*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_scheduler_init::default_num_threads()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::get_initial_auto_partitioner_divisor()' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::~task_group_context()' ../../lib/libopencv_core.so.3.0.0: 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.

Errors while building OpenCV 3.0.0 with -D BUILD_TBB flag.

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/libopencv_imgproc.so.3.0.0: undefined reference to tbb::task_group_context::cancel_group_execution()' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference totbb::interface5::internal::task_base::destroy(tbb::task&)' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::initialize(int)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task::note_affinity(unsigned short)' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::handle_perror(int, char const*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::internal::allocate_child_proxy::allocate(unsigned int) const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::NFS_Free(void*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::is_group_execution_cancelled() const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::throw_exception_v4(tbb::internal::exception_id)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_scheduler_init::terminate()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::initialize(int, unsigned int)' ../../lib/libopencv_core.so.3.0.0: undefined reference totypeinfo for tbb::task' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned int) const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference totbb::task_group_context::reset()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const' ../../lib/libopencv_core.so.3.0.0: undefined reference tovtable for tbb::task' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::init()' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::NFS_Allocate(unsigned int, unsigned int, void*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_scheduler_init::default_num_threads()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::get_initial_auto_partitioner_divisor()' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::~task_group_context()' ../../lib/libopencv_core.so.3.0.0: 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.

Update:

I also tried changing tbb source file (in 3rdparty/tbb/CMakeList.txt) to the latest one (4.3 update 6) since the default one is 4.1 update 2. But it didn't help.