Error in make OpenCV - file in wrong format

asked 2017-12-21 14:10:45 -0600

Paula gravatar image

Hello, I'm compiling OpenCV for Linux 64 bits. I'm having an issue with the following. I get an error that says "error adding symbols: File in wrong format"

[ 18%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/mathfuncs_core.avx.cpp.o
[ 18%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/convert.avx2.cpp.o
[ 18%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/mathfuncs_core.avx2.cpp.o
[ 18%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/stat.avx2.cpp.o
[ 18%] Linking CXX static library ../../../../../../lib/libcorrespondence.a
[ 18%] Built target correspondence
[ 18%] Linking CXX shared library ../../lib/libopencv_core.so
/usr/local/lib/libtbb.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
modules/core/CMakeFiles/opencv_core.dir/build.make:1743: recipe for target 'lib/libopencv_core.so.3.3.1' failed
make[2]: *** [lib/libopencv_core.so.3.3.1] Error 1
CMakeFiles/Makefile2:2219: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
[  0%] Built target gen-pkgconfig
[  1%] Built target ippiw
[  1%] Built target ittnotify
[  3%] Built target libprotobuf
[  3%] Built target opencv_core_pch_dephelp
[  3%] Built target pch_Generate_opencv_core
[  3%] Linking CXX shared library ../../lib/libopencv_core.so
/usr/local/lib/libtbb.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
modules/core/CMakeFiles/opencv_core.dir/build.make:1743: recipe for target 'lib/libopencv_core.so.3.3.1' failed
make[2]: *** [lib/libopencv_core.so.3.3.1] Error 1
CMakeFiles/Makefile2:2219: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

The commands I'm running are:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D FORCE_VTK=ON \
      -D INSTALL_C_EXAMPLES=ON \
      -D INSTALL_PYTHON_EXAMPLES=ON \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D USE_V4L=ON \
      -D WITH_QT=ON \
      -D WITH_OPENGL=ON \
      -D WITH_CUBLAS=ON \
      -D CUDA_NVCCFLAGS="-D_FORCE_INLINES" \
      -D WITH_GDAL=ON \
      -D WITH_XINE=ON \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D BUILD_EXAMPLES=ON ..
make -j 8

What could be the cause of this error? I have no idea where to begin looking. So far what I've found hasn't been helpful.

Thanks a lot

edit retag flag offensive close merge delete

Comments

well, the error is all about TBB, you probably do not have the dev- version of it.

you can disable TBB support, using cmake -D WITH_TBB=OFF

berak gravatar imageberak ( 2017-12-22 02:06:58 -0600 )edit

@berak , I do have the -dev version. So what could be it?

Paula gravatar imagePaula ( 2017-12-26 06:58:28 -0600 )edit