Arm crosscompile linking opencv

Hello

I have a crosscompile enviroment working on my ubuntu machine to compile for rpi.

I can compile a app without problem but o can not get linking an app where i want to use ofxCv

export GCC_PREFIX=arm-linux-gnueabihf
export GST_VERSION=1.0
export RPI_ROOT=/home/monde/LIFESENS_RPI/RPI_ROOT_STRETCH
export TOOLCHAIN_ROOT=/home/monde/of_raspberry_80x62/rpi_toolchain
export PLATFORM_OS=Linux
export PLATFORM_ARCH=armv6l
export PKG_CONFIG_LIBDIR=${RPI_ROOT}/usr/lib/pkgconfig:${RPI_ROOT}/usr/lib/${GCC_PREFIX}/pkgconfig:${RPI_ROOT}/usr/share/pkgconfig
export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++"
export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc"
export AR=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar
export LD=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld

and i have opencv in my “RPI_ROOT” libs and includes

This is the error im getting, i tried all day but no luck

ObjectFinder.o: In function `cvflann::anyimpl::big_any_policy<cv::String>::static_delete(void**)':
ObjectFinder.cpp:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv]+0x18): undefined reference to `cv::String::deallocate()'
/home/natxo/of_raspberry_80x62/addons/obj/linuxarmv6l/Release/ofxCv/libs/ofxCv/src/ObjectFinder.o: In function `cvflann::anyimpl::big_any_policy<cv::String>::move(void* const*, void**)':
ObjectFinder.cpp:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_]+0x10): undefined reference to `cv::String::deallocate()'
ObjectFinder.cpp:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_]+0x28): undefined reference to `cv::String::deallocate()'

Hope someone can help here!!!

I tried to redo the crosscompile enviroment but still not able to add opencv

Maybe @arturo or @jvcleave can help? im stucked here and i dont know what more to test

/home/monde/of_raspberry_80x62/RPI_ROOT_BUSTER/usr/lib/arm-linux-gnueabihf/libtbb.so.2: undefined reference to `std::current_exception()@CXXABI_1.3.3'
/home/monde/of_raspberry_80x62/RPI_ROOT_BUSTER/usr/lib/arm-linux-gnueabihf/libtbb.so.2: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(std::__exception_ptr::exception_ptr const&)@CXXABI_1.3.3'
/home/monde/of_raspberry_80x62/RPI_ROOT_BUSTER/usr/lib/arm-linux-gnueabihf/libtbb.so.2: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/home/monde/of_raspberry_80x62/RPI_ROOT_BUSTER/usr/lib/arm-linux-gnueabihf/libtbb.so.2: undefined reference to `std::__exception_ptr::exception_ptr::~exception_ptr()@CXXABI_1.3.3'
/home/monde/of_raspberry_80x62/RPI_ROOT_BUSTER/usr/lib/arm-linux-gnueabihf/libtbb.so.2: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
/home/monde/of_raspberry_80x62/RPI_ROOT_BUSTER/usr/lib/arm-linux-gnueabihf/libtbb.so.2: undefined reference to `std::rethrow_exception(std::__exception_ptr::exception_ptr)@CXXABI_1.3.3'
collect2: error: ld returned 1 exit status

Maybe is that gcc version of crosscompiler toolchain is 6.3.0 and opencv libs where compiled with a newer one?

EDIT: I compiled opencv with gcc 6.3.0 and now errors related to TBB… sems the same, is only a theory but looks like those libs are compiled with a version of gcc that is not compatible with the crosscompile oF toolchain for rpi that use 6.3.0

Yep, problem is that current toolchain is gcc 6.3.0 and buster use 8 so… thats a problem, i tried using a newer toolchain but was not able to make it work so solution was to use a old opencv compiled with 6.3.0 and that seems to not have tbb dependencie

1 Like