New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to cross-compile with some"undefined reference" errors #11878
Comments
This is build configuration problem.
|
@alalek thanks for the quick reply. but following your advice, i failed again:(
no errors occurred during build, and the built program run correctly on the target machine. |
Unfortunately we can't help on problems which we are not able to reproduce on our side (we don't have environment setup for this configuration). BTW, There two CMake lines seems wrong:
They should be CMake options (via Also take a look on OpenCV's cross-compiling GCC-based ARM toolchains here: https://github.com/opencv/opencv/tree/3.4/platforms/linux |
OpenCV3 allows to disable the usage of std::exception_ptr: opencv/opencv#11878 (comment) Fixes http://autobuild.buildroot.net/results/5ca/5ca221792c72c0a19f8b0e8303c0603d28f3c48e/ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
System information (version)
Detailed description
I have failed to cross-compile opencv3.4.1 with several '### undefined reference' errors related to std::exception_ptr
Steps to reproduce
My configuration is as follow:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D ENABLE_CXX11=ON -D ENABLE_NEON=ON -D ENABLE_VFPV3=ON -D BUILD_TESTS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_opencv_world=ON -D WITH_TBB=ON -D BUILD_TBB=ON -D WITH_JPEG=ON -D BUILD_JPEG=ON -D WITH_PNG=ON -D BUILD_PNG=ON -D WITH_TIFF=ON -D BUILD_TIFF=ON -D WITH_FFMPEG=ON -D BUILD_opencv_apps=OFF -D CMAKE_TOOLCHAIN_FILE=mypath/toolchain.cmake ..
And, My toolchain.cmake file look like these:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER /opt/arm-hisiv600-linux/bin/arm-hisiv600-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER /opt/arm-hisiv600-linux/bin/arm-hisiv600-linux-gnueabi-g++)
set(CMAKE_FIND_ROOT_PATH /opt/arm-hisiv600-linux/arm-hisiv600-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
add_definitions(-DENABLE_NEON=ON)
add_definitions(-DENABLE_VFPV3=ON)
set(CMAKE_C_FLAGS "-mcpu=cortex-a17.cortex-a7 -mfpu=neon-vfpv4 -mfp16-format=ieee -mfloat-abi=softfp -mno-unaligned-access -fno-aggressive-loop-optimizations")
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_C_FLAGS}")
After several minutes, I got some errors as follow:
[ 88%] Built target opencv_ts
[ 89%] Building CXX object modules/world/CMakeFiles/opencv_perf_dnn.dir//dnn/perf/opencl/perf_convolution.cpp.o
[ 89%] Building CXX object modules/world/CMakeFiles/opencv_perf_dnn.dir//dnn/perf/perf_caffe.cpp.o
[ 89%] Building CXX object modules/world/CMakeFiles/opencv_perf_dnn.dir//dnn/perf/perf_convolution.cpp.o
[ 89%] Building CXX object modules/world/CMakeFiles/opencv_perf_dnn.dir//dnn/perf/perf_main.cpp.o
[ 89%] Building CXX object modules/world/CMakeFiles/opencv_perf_dnn.dir/__/dnn/perf/perf_net.cpp.o
[ 89%] Linking CXX executable ../../bin/opencv_perf_dnn
../../lib/libopencv_world.so.4.0.0: undefined reference to
std::rethrow_exception(std::__exception_ptr::exception_ptr)' ../../lib/libopencv_world.so.4.0.0: undefined reference to
std::__exception_ptr::exception_ptr::exception_ptr()'../../lib/libopencv_world.so.4.0.0: undefined reference to
std::current_exception()' ../../lib/libopencv_world.so.4.0.0: undefined reference to
std::__exception_ptr::exception_ptr::exception_ptr(std::__exception_ptr::exception_ptr const&)'../../lib/libopencv_world.so.4.0.0: undefined reference to
std::__exception_ptr::exception_ptr::swap(std::__exception_ptr::exception_ptr&)' ../../lib/libopencv_world.so.4.0.0: undefined reference to
std::__exception_ptr::exception_ptr::~exception_ptr()'collect2: error: ld returned 1 exit status
make[2]: *** [modules/world/CMakeFiles/opencv_perf_dnn.dir/build.make:147:bin/opencv_perf_dnn] Error 1
make[1]: *** [CMakeFiles/Makefile2:1795:modules/world/CMakeFiles/opencv_perf_dnn.dir/all] Error 2
make: *** [Makefile:163:all] Error 2
I have set "-D ENABLE_CXX11=ON", and add "-std=c++11" to CMAKE_CXX_FLAGS (in the toolchain.cmake file), but still failed. Could anyone help me? Thanks :)
The text was updated successfully, but these errors were encountered: