Issues with Building OpenCV for Android using Qt 6.4.2 on Windows 10
-
@Kaguro said in Issues with Building OpenCV for Android using Qt 6.4.2 on Windows 10:
armeabi-v7a
I'm not sure this is the correct ABI. Check the ABI of your Android Qt installation, it is probably v8a. ABIs must match.
-
@Kaguro Then look in the build log for linker warnings: if some libs are incompatible you will get warning.
And as I suggested before: check which libraries provide the symbols which are not found and then check whether you link these libs.
For example carotene_o4t::isSupportedConfiguration seems to come from libtegra_hal (see https://stackoverflow.com/questions/41665655/what-is-carotene-o4t-and-why-does-it-cause-issues-with-compiling-a-program-using). -
@Kaguro said in Issues with Building OpenCV for Android using Qt 6.4.2 on Windows 10:
this can be the problem?
It can if the ABIs do not match.
-
@jsulm
so I try this now:LIBS += \ -L"F:/Asztal/VP/mew/OpenCV-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/" \ -L"F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/libs/armeabi-v7a/" \ -L"F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/" \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_core \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_dnn \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_flann \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_highgui \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_gapi \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_ml \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_objdetect \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_photo \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_imgproc \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_imgcodecs \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_features2d \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_calib3d \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_video \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_videoio \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a -ltegra_hal \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_stitching \ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a -ltbb
And now I got "only" 15 errors for example:
:-1: error: error: undefined symbol: android_getCpuFeatures
:-1: error: error: undefined symbol: __itt_thread_set_name_ptr__3_0
:-1: error: error: undefined symbol: __itt_string_handle_create_ptr__3_0
(etc..)And it looks like this is from libopencv_core. But I already linked the libopencv_core
-
@jsulm Sorry I am really a beginner and I don't understand exactly what you would ask for.
I just see errors and this is the whole log what I see :C:\Users\Kaguro\AppData\Local\Android\Sdk\ndk\23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -target armv7a-linux-androideabi23 -fno-limit-debug-info -Wl,--exclude-libs,libunwind.a -Wl,-soname,libPoorMans_thatsyou_client_armeabi-v7a.so -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libPoorMans_thatsyou_client_armeabi-v7a.so @object_script.libPoorMans_thatsyou_client_armeabi-v7a.so -LF:/Asztal/VP/mew/OpenCV-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a/ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/libs/armeabi-v7a/ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/ -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a -lopencv_core -lopencv_dnn -lopencv_flann -lopencv_highgui -lopencv_gapi -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_imgproc -lopencv_imgcodecs -lopencv_features2d -lopencv_calib3d -lopencv_video -lopencv_videoio -LF:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/3rdparty/libs/armeabi-v7a -ltegra_hal -lopencv_stitching -ltbb D:/Qt/6.4.2/android_armv7/lib/libQt6MultimediaWidgets_armeabi-v7a.so D:/Qt/6.4.2/android_armv7/lib/libQt6Multimedia_armeabi-v7a.so D:/Qt/6.4.2/android_armv7/lib/libQt6Widgets_armeabi-v7a.so D:/Qt/6.4.2/android_armv7/lib/libQt6Gui_armeabi-v7a.so -lEGL D:/Qt/6.4.2/android_armv7/lib/libQt6Network_armeabi-v7a.so D:/Qt/6.4.2/android_armv7/lib/libQt6Core_armeabi-v7a.so -llog -pthread -lGLESv2 -llog -lz -lm -ldl -lc ld: error: undefined symbol: android_getCpuFeatures >>> referenced by system.cpp >>> system.cpp.o:(cv::HWFeatures::initialize()) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_thread_set_name_ptr__3_0 >>> referenced by system.cpp >>> system.cpp.o:(cv::TLSData<cv::(anonymous namespace)::ThreadID>::createDataInstance() const) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_string_handle_create_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::LocationExtraData::LocationExtraData(cv::utils::trace::details::Region::LocationStaticStorage const&)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::Impl::leaveRegion(cv::utils::trace::details::TraceManagerThreadLocal&)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::TraceManager::TraceManager()) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a >>> referenced 1 more times ld: error: undefined symbol: __itt_api_version_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::isITTEnabled()) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_domain_create_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::isITTEnabled()) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_id_create_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::Impl::Impl(cv::utils::trace::details::TraceManagerThreadLocal&, cv::utils::trace::details::Region*, cv::utils::trace::details::Region&, cv::utils::trace::details::Region::LocationStaticStorage const&, long long)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::Impl::registerRegion(cv::utils::trace::details::TraceManagerThreadLocal&)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_task_begin_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::Impl::enterRegion(cv::utils::trace::details::TraceManagerThreadLocal&)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_id_destroy_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::Impl::~Impl()) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_metadata_add_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::Impl::leaveRegion(cv::utils::trace::details::TraceManagerThreadLocal&)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::traceArg(cv::utils::trace::details::TraceArg const&, int)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::traceArg(cv::utils::trace::details::TraceArg const&, long long)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a >>> referenced 1 more times ld: error: undefined symbol: __itt_task_end_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::Region::Impl::leaveRegion(cv::utils::trace::details::TraceManagerThreadLocal&)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_region_begin_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::TraceManager::TraceManager()) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_region_end_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::TraceManager::~TraceManager()) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_relation_add_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::parallelForAttachNestedRegion(cv::utils::trace::details::Region const&)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a ld: error: undefined symbol: __itt_metadata_str_add_ptr__3_0 >>> referenced by trace.cpp >>> trace.cpp.o:(cv::utils::trace::details::traceArg(cv::utils::trace::details::TraceArg const&, char const*)) in archive F:/Asztal/VP/new/OpenCV-android-sdk/sdk/native/staticlibs/armeabi-v7a/libopencv_core.a clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:121: libPoorMans_thatsyou_client_armeabi-v7a.so] Error 1 15:40:32: The process "C:\Users\Kaguro\AppData\Local\Android\Sdk\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" exited with code 2. 15:40:33: Error while building/deploying project PoorMans_thatsyou_client (kit: Android Qt 6.4.2 Clang armeabi-v7a) 15:40:33: When executing step "Make"
The opencv and the Qt use the same armeabi-v7a.