Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cross-compile for ARM

Hi,

I'm trying to cross-build OpenCV for ARM using a Docker image, but I'm getting linking errors. Does anyone have an idea how to resolve those linking errors ?

../../lib/libopencv_core.so.4.1.1: undefined reference to `gzeof'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzrewind'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzopen'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzclose'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzgets'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzputs'
collect2: error: ld returned 1 exit status
apps/version/CMakeFiles/opencv_version.dir/build.make:84: recipe for target 'bin/opencv_version' failed

Thanks for helping

Cross-compile for ARM

Hi,

I'm trying to cross-build OpenCV for ARM using a Docker image, but I'm getting linking errors. Does anyone have an idea how to resolve those linking errors ?

../../lib/libopencv_core.so.4.1.1: undefined reference to `gzeof'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzrewind'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzopen'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzclose'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzgets'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzputs'
collect2: error: ld returned 1 exit status
apps/version/CMakeFiles/opencv_version.dir/build.make:84: recipe for target 'bin/opencv_version' failed

with cmake

cmake command:

cmake \
   -D CMAKE_BUILD_TYPE=RELEASE \
   -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules/ \
   -D ENABLE_NEON=ON \
   -D ENABLE_VFPV3=ON \
   -D ENABLE_LTO=ON \
   -D SOFTFP=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 \
   -D BUILD_ZLIB=ON \
   -D WITH_CAROTENE=OFF \
   -D WITH_ITT=OFF \
   -D WITH_CUDA=OFF \
   -D OPENCV_EXTRA_EXE_LINKER_FLAGS=-lzlib \
   -D ENABLE_PRECOMPILED_HEADERS=OFF \
   -D OPENCV_ENABLE_NONFREE=ON \
   -D CMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake \
   -D CMAKE_SYSTEM_PROCESSOR=armv7l \
   -D CMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \
   -D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
   -D BUILD_opencv_python2=OFF \
   -D BUILD_opencv_python3=ON \
   -D PYTHON_EXECUTABLE=$(which python3) \
   -D PYTHON_LIBRARY=$(python3 -c "from distutils.sysconfig import get_config_var;from os.path import dirname,join ; print(join(dirname(get_config_var('LIBPC')),get_config_var('LDLIBRARY')))") \
   -D PYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
   -D PYTHON3_NUMPY_INCLUDE_DIRS=$(python3 -c "import numpy; print(numpy.get_include())") ..

Thanks for helping

Cross-compile for ARM

Hi,

I'm trying to cross-build OpenCV for ARM using a Docker image, but I'm getting linking errors. Does anyone have an idea how to resolve those linking errors ?

../../lib/libopencv_core.so.4.1.1: undefined reference to `gzeof'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzrewind'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzopen'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzclose'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzgets'
../../lib/libopencv_core.so.4.1.1: undefined reference to `gzputs'
collect2: error: ld returned 1 exit status
apps/version/CMakeFiles/opencv_version.dir/build.make:84: recipe for target 'bin/opencv_version' failed

with cmake

cmake command:

cmake \
   -D CMAKE_BUILD_TYPE=RELEASE \
   -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules/ \
   -D ENABLE_NEON=ON \
   -D ENABLE_VFPV3=ON \
   -D ENABLE_LTO=ON \
   -D SOFTFP=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 \
   -D BUILD_ZLIB=ON \
   -D WITH_CAROTENE=OFF \
   -D WITH_ITT=OFF \
   -D WITH_CUDA=OFF \
   -D OPENCV_EXTRA_EXE_LINKER_FLAGS=-lzlib \
   -D ENABLE_PRECOMPILED_HEADERS=OFF \
   -D OPENCV_ENABLE_NONFREE=ON \
   -D CMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake \
   -D CMAKE_SYSTEM_PROCESSOR=armv7l \
   -D CMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \
   -D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
   -D BUILD_opencv_python2=OFF \
   -D BUILD_opencv_python3=ON \
   -D PYTHON_EXECUTABLE=$(which python3) \
   -D PYTHON_LIBRARY=$(python3 -c "from distutils.sysconfig import get_config_var;from os.path import dirname,join ; print(join(dirname(get_config_var('LIBPC')),get_config_var('LDLIBRARY')))") \
   -D PYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
   -D PYTHON3_NUMPY_INCLUDE_DIRS=$(python3 -c "import numpy; print(numpy.get_include())") ..

Thanks for helping