OpenCV with CMake config failed
-
wrote on 30 Jan 2024, 23:40 last edited by
Hello,
I am trying to use OpenCV in order to take pictures of the front camera in Qt, but I have trouble with the CMake configuration and most likely hadbuilt OpenCV incorrectly.
I have followed exactly this guide ( the example ) to built OpenCV with no errors - https://docs.opencv.org/4.x/d0/d76/tutorial_arm_crosscompile_with_cmake.html
In my CMake file I have a lot of code that I will not show because I do not think it is necessary.
CMakeLists.txt
.. find_package(OpenCV REQUIRED) target_link_libraries(androidnotifier PRIVATE Qt6::Multimedia Qt6::Widgets Qt6::Core Qt6::CorePrivate ${OpenCV_LIBS}) ..
However, after those commands:
cmake -DCMAKE_TOOLCHAIN_FILE=/home/ivelin/Qt/6.2.4/android_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake . make adb install -r android-build/androidnotifier.apk
I get
[ 70%] Linking CXX shared module libandroidnotifier_arm64-v8a.so ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_gapi.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_highgui.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_ml.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_objdetect.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_photo.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_stitching.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_video.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_videoio.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_imgcodecs.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_dnn.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_calib3d.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_features2d.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_flann.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_imgproc.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_core.so.4.9.0 is incompatible with aarch64linux clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Why is that ? Could someone please take a look ?
-
Hello,
I am trying to use OpenCV in order to take pictures of the front camera in Qt, but I have trouble with the CMake configuration and most likely hadbuilt OpenCV incorrectly.
I have followed exactly this guide ( the example ) to built OpenCV with no errors - https://docs.opencv.org/4.x/d0/d76/tutorial_arm_crosscompile_with_cmake.html
In my CMake file I have a lot of code that I will not show because I do not think it is necessary.
CMakeLists.txt
.. find_package(OpenCV REQUIRED) target_link_libraries(androidnotifier PRIVATE Qt6::Multimedia Qt6::Widgets Qt6::Core Qt6::CorePrivate ${OpenCV_LIBS}) ..
However, after those commands:
cmake -DCMAKE_TOOLCHAIN_FILE=/home/ivelin/Qt/6.2.4/android_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake . make adb install -r android-build/androidnotifier.apk
I get
[ 70%] Linking CXX shared module libandroidnotifier_arm64-v8a.so ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_gapi.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_highgui.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_ml.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_objdetect.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_photo.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_stitching.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_video.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_videoio.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_imgcodecs.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_dnn.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_calib3d.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_features2d.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_flann.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_imgproc.so.4.9.0 is incompatible with aarch64linux ld: error: /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_core.so.4.9.0 is incompatible with aarch64linux clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Why is that ? Could someone please take a look ?
@Ivelin said in OpenCV with CMake config failed:
Why is that ?
Because the OpenCV libraries you're using are not aarch64linux as the error messages say. For what platform OpenCV libs you're using were built (you can check with command "file /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_gapi.so.4.9.0".
-
@Ivelin said in OpenCV with CMake config failed:
Why is that ?
Because the OpenCV libraries you're using are not aarch64linux as the error messages say. For what platform OpenCV libs you're using were built (you can check with command "file /home/ivelin/opencv/platforms/linux/build_hardpf/lib/libopencv_gapi.so.4.9.0".
-
1/3