Ask Your Question

Revision history [back]

Undefined ld references when building from source

I'm getting various undefined references to atomic types.

[ 40%] Linking CXX executable ../../bin/opencv_perf_core
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_store_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_load_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_compare_exchange_8'

I'm trying to build OpenCV-4.1.1 from source on a Raspberry Pi 3. Currently using these options in CMake. Any ideas?

cmake -D CMAKE_BUILD_TYPE=RELEASE \
   -D CMAKE_INSTALL_PREFIX=/usr/local/ \
   -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-master/modules/ \
   -D ENABLE_NEON=ON \
   -D ENABLE_VFPV3=ON \
   -D ENABLE_LTO=ON \
   -D CPU_BASELINE=NEON \
   -D WITH_TBB=ON \
   -D WITH_OPENCL=ON \
   -D WITH_GSTREAMER=ON \
   -D BUILD_EXAMPLES=OFF \
   -D BUILD_TESTS=OFF \
   -D BUILD_SHARED=OFF ..
click to hide/show revision 2
retagged

updated 2019-07-29 16:47:38 -0600

berak gravatar image

Undefined ld references when building from source

I'm getting various undefined references to atomic types.

[ 40%] Linking CXX executable ../../bin/opencv_perf_core
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_store_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_load_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to `__atomic_compare_exchange_8'

I'm trying to build OpenCV-4.1.1 from source on a Raspberry Pi 3. Currently using these options in CMake. Any ideas?

cmake -D CMAKE_BUILD_TYPE=RELEASE \
   -D CMAKE_INSTALL_PREFIX=/usr/local/ \
   -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-master/modules/ \
   -D ENABLE_NEON=ON \
   -D ENABLE_VFPV3=ON \
   -D ENABLE_LTO=ON \
   -D CPU_BASELINE=NEON \
   -D WITH_TBB=ON \
   -D WITH_OPENCL=ON \
   -D WITH_GSTREAMER=ON \
   -D BUILD_EXAMPLES=OFF \
   -D BUILD_TESTS=OFF \
   -D BUILD_SHARED=OFF ..