2

I have cross-compiled Qt on my CentOS host for my Raspberry Pi and now I want to cross-compile OpenCV with the following script:

CORES=4
IP=192.168.178.52
TEMP_PATH=/home/kampi/OpenCV
SYSROOT_PATH=/home/kampi/Toolchain/RaspberryPi/sysroot
TOOLCHAIN_PATH=/home/kampi/Toolchain/RaspberryPi
INSTALL_PATH=/usr/local
WITH_QT=ON
QT_PATH=/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt

echo -e ${Yellow}"Create directories..."${Reset}
mkdir -p ${TEMP_PATH}/log ${SYSROOT_PATH}

echo -e ${Yellow}"Download OpenCV sources..."${Reset}
cd ${TEMP_PATH}
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git

echo -e ${Yellow}"Download /lib..."${Reset}
rsync -avz root@${IP}:/lib ${SYSROOT_PATH} | tee ${TEMP_PATH}/log/copy_lib.log
echo -e ${Yellow}"Download /usr/include..."${Reset}
rsync -avz root@${IP}:/usr/include ${SYSROOT_PATH}/usr | tee ${TEMP_PATH}/log/copy_usr_include.log
echo -e ${Yellow}"Download /usr/lib..."${Reset}
rsync -avz root@${IP}:/usr/lib ${SYSROOT_PATH}/usr | tee ${TEMP_PATH}/log/copy_usr_lib.log
echo -e ${Yellow}"Download /opt/vc..."${Reset}
rsync -avz root@${IP}:/opt/vc ${SYSROOT_PATH}/opt | tee ${TEMP_PATH}/log/copy_opt_vc.log
echo -e ${Yellow}"Download /usr/local..."${Reset}
rsync -avz root@${IP}:/usr/local ${SYSROOT_PATH}/usr | tee ${TEMP_PATH}/log/copy_usr_local.log

echo -e ${Yellow}"Change symlinks..."${Reset}
${TOOLCHAIN_PATH}/sysroot-relativelinks.py ${SYSROOT_PATH}

echo -e ${Yellow}"Configure build..."${Reset}
cd ${TEMP_PATH}/opencv
mkdir -p ${TEMP_PATH}/opencv/build && cd build
cmake -D CMAKE_C_COMPILER=${TOOLCHAIN_PATH}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc \
    -D CMAKE_LIBRARY_PATH=${SYSROOT_PATH}/opt/vc/lib \
    -D CMAKE_CXX_COMPILER=${TOOLCHAIN_PATH}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ \
    -D CMAKE_C_FLAGS=${CMAKE_C_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4 \
    -D CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4 \
    -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=${SYSROOT_PATH}${INSTALL_PATH}/OpenCV \
    -D CMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake \
    -D OPENCV_EXTRA_MODULES_PATH=${TEMP_PATH}/opencv_contrib/modules \
    -D OPENCV_ENABLE_NONFREE=OFF \
    -D ENABLE_NEON=ON \
    -D ENABLE_VFPV3=ON \
    -D WITH_GTK=ON \
    -D WITH_OPENGL=ON \
    -D WITH_V4L=ON \
    -D WITH_QT=${WITH_QT} \
    -D Qt5_DIR=${QT_PATH}/lib/cmake/Qt5 \
    -D QT_QMAKE_EXECUTABLE=${QT_PATH}/bin/qmake \
    -D Qt5Concurrent_DIR=${QT_PATH}/lib/cmake/Qt5Concurrent \
    -D Qt5Core_DIR=${QT_PATH}/lib/cmake/Qt5Core \
    -D Qt5Gui_DIR=${QT_PATH}/lib/cmake/Qt5Gui \
    -D Qt5OpenGL_DIR=${QT_PATH}/lib/cmake/Qt5OpenGL \
    -D Qt5Test_DIR=${QT_PATH}/lib/cmake/Qt5Test \
    -D Qt5Widgets_DIR=${QT_PATH}/lib/cmake/Qt5Widgets \
    -D _qt5gui_OPENGL_INCLUDE_DIR=${SYSROOT_PATH}/opt/vc/include \
    -D BUILD_TESTS=OFF \
    -D BUILD_DOCS=OFF \
    -D BUILD_OPENCV_PYTHON2=OFF \
    -D BUILD_OPENCV_PYTHON3=OFF \
    -D BUILD_EXAMPLES=OFF \
    .. | tee ${TEMP_PATH}/log/configure.log

echo -e ${Yellow}"Build OpenCV..."${Reset}
make -j${CORES} | tee ${TEMP_PATH}/log/make.log
make install | tee ${TEMP_PATH}/log/install.log

echo -e ${Yellow}"Upload /lib..."${Reset}
rsync -avz ${SYSROOT_PATH}/sysroot/lib root@${IP}:/ | tee ${TEMP_PATH}/log/copy_lib.log
ssh root@${IP} "chown -R root:root /lib"

echo -e ${Yellow}"Upload /usr/include..."${Reset}
rsync -avz ${SYSROOT_PATH}/sysroot/usr/include root@${IP}:/usr | tee ${TEMP_PATH}/log/copy_usr_include.log
ssh root@${IP} "chown -R root:root /usr/include"

echo -e ${Yellow}"Upload /usr/lib..."${Reset}
rsync -avz ${SYSROOT_PATH}/sysroot/usr/lib root@${IP}:/usr | tee ${TEMP_PATH}/log/copy_usr_lib.log
ssh root@${IP} "chown -R root:root /usr/lib"

echo -e ${Yellow}"Upload /opt/vc..."${Reset}
rsync -avz ${SYSROOT_PATH}/sysroot/opt/vc root@${IP}:/opt | tee ${TEMP_PATH}/log/copy_opt_vc.log
ssh root@${IP} "chown -R root:root /opt/vc"

echo -e ${Yellow}"Upload /usr/local..."${Reset}
rsync -avz ${SYSROOT_PATH}/sysroot/usr/local root@${IP}:/usr | tee ${TEMP_PATH}/log/upload_usr_local.log
ssh root@${IP} "chown -R root:root /usr/local"

But the build fails with the following error messages:

[ 99%] Building CXX object modules/stereo/CMakeFiles/opencv_perf_stereo.dir/perf/perf_main.cpp.o
[ 99%] Linking CXX executable ../../bin/opencv_perf_stereo
[ 99%] Built target opencv_perf_stereo
[ 99%] Linking CXX executable ../../bin/opencv_annotation
/home/kampi/Toolchain/RaspberryPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libpng16.so.16, needed by /home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5, not found (try using -rpath or -rpath-link)
/home/kampi/Toolchain/RaspberryPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libz.so.1, needed by /home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5, not found (try using -rpath or -rpath-link)
/home/kampi/Toolchain/RaspberryPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libharfbuzz.so.0, needed by /home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5, not found (try using -rpath or -rpath-link)
/home/kampi/Toolchain/RaspberryPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libpcre2-16.so.0, needed by /home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
/home/kampi/Toolchain/RaspberryPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libdouble-conversion.so.1, needed by /home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
/home/kampi/Toolchain/RaspberryPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libgthread-2.0.so.0, needed by /home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
/home/kampi/Toolchain/RaspberryPi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libglib-2.0.so.0, needed by /home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_source_destroy'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_set_nominal_glyph_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_create_read_struct@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_mirroring_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_jit_stack_create_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `renameat2@GLIBC_2.28'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_interlace_handling@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_source_set_can_recurse'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `crc32'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_IHDR@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_face_destroy'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_compile_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_general_category_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_image_width@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_io_ptr@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_blob_create'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_set_ptem'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_create'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_jit_stack_assign_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_oFFs@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_new'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_eastasian_width_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_blob_get_empty'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_match_data_create_from_pattern_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `statx@GLIBC_2.28'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_source_remove_poll'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `inflateInit2_'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_longjmp_fn@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_set_glyph_h_advance_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_get_glyph_positions'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_get_glyph_infos'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_gray_to_rgb@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_PLTE@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_destroy'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `getentropy@GLIBC_2.25'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_compression_level@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_match_context_free_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_destroy'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_is_immutable'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_create'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_text@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_source_unref'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_add_utf16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_face_is_immutable'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_set_font_h_extents_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_gAMA@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_filler@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_bgr@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_pattern_info_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `clock_gettime@GLIBC_2.17'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_set_glyph_contour_point_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_face_set_index'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_valid@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_write_rows@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_decompose_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_default'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_set_ppem'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_face_create_for_tables'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_PLTE@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_sig_bytes@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_create'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_set_segment_properties'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_write_chunk@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_pHYs@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `inflate'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_match_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_decompose_compatibility_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_destroy_read_struct@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_swap@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `compress2'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_IHDR@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_combining_class_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_set_funcs'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_guess_segment_properties'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_x_pixels_per_meter@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_jit_compile_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_clear_contents'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_read_row@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_source_new'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_iteration'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_reverse'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_expand@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_option@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_set_flags'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_set_scale'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_allocation_successful'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_pending'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_pre_allocate'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_face_set_upem'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_set_variation_glyph_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `double_conversion::StringToDoubleConverter::StringToDouble(char const*, int, int*) const'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `deflateInit2_'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_tRNS@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_match_context_create_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_set_user_data'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_error_fn@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_ot_layout_table_find_script'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_code_free_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Test.so.5: undefined reference to `fcntl@GLIBC_2.28'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_write_info@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_ot_tags_from_script'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_get_ovector_pointer_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `deflateInit_'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_set_unicode_funcs'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_destroy'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_source_add_poll'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_shape_full'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_get_user_data'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_compose_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_get_error_message_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_destroy'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_substring_number_from_name_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_packing@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_wakeup'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_oFFs@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_read_fn@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_create_info_struct@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_read_end@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_read_update_info@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_get_length'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_config_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `deflate'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_write_image@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_make_immutable'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `uncompress'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_push_thread_default'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_y_pixels_per_meter@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_write_end@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_gamma@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_image_height@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `deflateEnd'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_set_glyph_extents_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_create_write_struct@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_ref'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_read_image@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_invert_mono@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_unicode_funcs_set_script_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `compress'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_read_info@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_match_data_free_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_buffer_create'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_write_fn@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_get_channels@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_tRNS@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_gAMA@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `inflateEnd'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_source_attach'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_destroy_write_struct@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_error@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_pop_thread_default'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `hb_font_funcs_set_glyph_h_kerning_func'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `pcre2_jit_stack_free_16'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_packswap@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `double_conversion::DoubleToStringConverter::DoubleToAscii(double, double_conversion::DoubleToStringConverter::DtoaMode, int, char*, int, bool*, int*, int*)'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_text@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Gui.so.5: undefined reference to `png_set_strip_16@PNG16_0'
/home/kampi/Toolchain/RaspberryPi/sysroot/usr/local/RaspberryQt/lib/libQt5Core.so.5: undefined reference to `g_main_context_unref'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_annotation] Fehler 1
make[1]: *** [apps/annotation/CMakeFiles/opencv_annotation.dir/all] Fehler 2
make: *** [all] Fehler 2

So it seems that some dependencies are missing, but I can not figure out how I can fix this issue.

1
  • Can you please provide how you cross compiled with qt on cent os? I tried about 9 different manuals and it took me weeks and always without success. Cross compiling for android is no problem - but rpi zero w gives me headake.. Thanks upfront
    – Ingo Mi
    Jun 17, 2020 at 20:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.