I build (static and dynamic)the AWS SDK CPP library on my PC for Android Applications. After that, I developped an Android Application with Qt 5.10 using this AWS CPP librairy but at the end, during the link, I have many errors. I tried on MacOS and Windows 10 but I have the same errors and I used the ANDROID NDK 12 because is the only working to build the AWS SDK CPP library.
I tried to solve it during 2 weeks. Please Someone could help me ?
Here is my command of the linker and the result :
C:\Android_aws_sdk_cpp\android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -D__ANDROID_API__=16 --sysroot=C:\Android_aws_sdk_cpp\android-ndk-r12b/platforms/android-16/arch-arm/ -isystem C:\Android_aws_sdk_cpp\android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:\Android_aws_sdk_cpp\android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -DANDROID -DANDROID_NDK -DAWS_CUSTOM_MEMORY_MANAGEMENT -fPIC -fexceptions -O2 -Os -mthumb -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_CHARTS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../crio_Source -I. -I../aws-sdk-cpp/aws_build_android/build_static/include -I../../../../Qt/5.10.1/android_armv7/include -I../../../../Qt/5.10.1/android_armv7/include/QtQuick -I../../../../Qt/5.10.1/android_armv7/include/QtCharts -I../../../../Qt/5.10.1/android_armv7/include/QtWidgets -I../../../../Qt/5.10.1/android_armv7/include/QtGui -I../../../../Qt/5.10.1/android_armv7/include/QtQml -I../../../../Qt/5.10.1/android_armv7/include/QtNetwork -I../../../../Qt/5.10.1/android_armv7/include/QtCore -I. -I../../../../Qt/5.10.1/android_armv7/mkspecs/android-g++ -o moc_listSensorModel.obj moc_listSensorModel.cpp
C:\Android_aws_sdk_cpp\android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ --sysroot=C:\Android_aws_sdk_cpp\android-ndk-r12b/platforms/android-16/arch-arm/ -Wl,-soname,libcrio_Android.so -Wl,-rpath=C:/Qt/5.10.1/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libcrio_Android.so emailaddress.obj mimeattachment.obj mimecontentformatter.obj mimefile.obj mimehtml.obj mimeinlinefile.obj mimemessage.obj mimemultipart.obj mimepart.obj mimetext.obj quotedprintable.obj smtpclient.obj controleur.obj listGroupModel.obj listSensorModel.obj main.obj sensorInformation.obj qrc_qml.obj moc_emailaddress.obj moc_mimeattachment.obj moc_mimecontentformatter.obj moc_mimefile.obj moc_mimehtml.obj moc_mimemultipart.obj moc_mimepart.obj moc_quotedprintable.obj moc_smtpclient.obj moc_controleur.obj moc_listGroupModel.obj moc_listSensorModel.obj -LC:\Android_aws_sdk_cpp\android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -Lc:/android_aws_sdk_cpp/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x -LC:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib -laws-cpp-sdk-core -laws-cpp-sdk-lambda -laws-cpp-sdk-cognito-identity -laws-cpp-sdk-cognito-idp -laws-cpp-sdk-identity-management -LC:/Qt/5.10.1/android_armv7/lib -lQt5Quick -Lc:\utils\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -Lc:/utils/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.9 -LC:\Qt\5.10.1\android_armv7/lib -lQt5Charts -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lgnustl_shared -lgcc -llog -lz -lm -ldl -lc**
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::AmazonStreamingWebServiceRequest::~AmazonStreamingWebServiceRequest(): error: undefined reference to 'std::__ndk1::__shared_weak_count::__release_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::AmazonStreamingWebServiceRequest::~AmazonStreamingWebServiceRequest(): error: undefined reference to 'std::__ndk1::__shared_weak_count::__release_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Utils::Stream::DefaultResponseStreamFactoryMethod(): error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::__shared_weak_count::__add_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::__shared_weak_count::__release_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::__shared_weak_count::__release_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::__shared_weak_count::__add_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::locale::locale()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::locale::~locale()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::InitAPI(Aws::SDKOptions const&): error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Utils::Logging::InitializeAWSLogging(std::__ndk1::shared_ptr<Aws::Utils::Logging::LogSystemInterface> const&): error: undefined reference to 'std::__ndk1::__shared_weak_count::__add_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> >::~basic_ostringstream(): error: undefined reference to 'std::__ndk1::locale::~locale()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> >::~basic_ostringstream(): error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Client::AWSAuthV4Signer::AWSAuthV4Signer(std::__ndk1::shared_ptr<Aws::Auth::AWSCredentialsProvider> const&, char const*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy, bool): error: undefined reference to 'std::__ndk1::__shared_weak_count::__add_shared()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Client::AWSAuthV4Signer::ComputeLongLivedHash(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&) const: error: undefined reference to 'std::__ndk1::mutex::lock()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Client::AWSAuthV4Signer::ComputeLongLivedHash(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&) const: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Client::AWSAuthV4Signer::ComputeLongLivedHash(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&) const: error: undefined reference to 'std::__ndk1::locale::locale()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Client::AWSAuthV4Signer::ComputeLongLivedHash(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&) const: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Client::AWSAuthV4Signer::ComputeLongLivedHash(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&) const: error: undefined reference to 'std::__ndk1::locale::locale()'
C:/Users/Benjamin/OneDrive/aws-sdk-cpp/aws_build_android/build_static/lib/libaws-cpp-sdk-core.a(ub_core.cpp.o):C:\Android_aws_sdk_cpp\aws-cpp-sdk-core\ub_core.cpp:function Aws::Client::AWSAuthV4Signer::ComputeLongLivedHash(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, Aws::Allocator<char> > const&) const: error: undefined reference to 'std::__ndk1::locale::locale()'
...
...
...
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [libcrio_Android.so] Error 1
Makefile:154: recipe for target 'libcrio_Android.so' failed
15:50:30: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project crio_Android (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.10.1 for Android armv7))
When executing step "Make"
Related
I am trying to start project:
https://mechatronicsblog.com/tensorflow-lite-integration-with-qt-and-v-play-for-multi-platform-machine-learning-apps-on-ios-and-android/
But there is an issue - Tensorflow submodule is incorrect.
I downloaded Tensorflow library from main repo by the following command:
git clone https://github.com/tensorflow/tensorflow.git
Then I updated dependencies:
tensorflow/lite/tools/make/download_dependencies.sh
Then I built the library by the following command:
bazel build --cxxopt='-D_GLIBCXX_USE_CXX11_ABI=0' -c opt --config=android_arm tensorflow/lite/java:libtensorflowlite_jni
Here's what WORKSPACE looks like:
android_sdk_repository(
name = "androidsdk",
api_level = 21,
build_tools_version = "26.0.2",
path = "/home/user/Android/SDK",
)
android_ndk_repository(
name = "androidndk",
api_level = 20,
path = "/home/user/android-ndk-r20b",
)
The result was successful.
Then I copied the library folder and pasted it in the root of the project folder.
I did not change .pro file
# TensorFlow Lite - Global
TENSORFLOW_PATH = $$PWD/tensorflow/
TFLITE_MAKE_PATH = $$TENSORFLOW_PATH/tensorflow/lite/tools/make
INCLUDEPATH += $$TENSORFLOW_PATH \
$$TFLITE_MAKE_PATH/downloads/ \
$$TFLITE_MAKE_PATH/downloads/eigen \
$$TFLITE_MAKE_PATH/downloads/gemmlowp \
$$TFLITE_MAKE_PATH/downloads/neon_2_sse \
$$TFLITE_MAKE_PATH/downloads/farmhash/src \
$$TFLITE_MAKE_PATH/downloads/flatbuffers/include
# TensorFlow Lite - Linux
linux:!android {
INCLUDEPATH += -L$$TFLITE_MAKE_PATH/gen/linux_x86_64/obj
LIBS += -L$$TFLITE_MAKE_PATH/gen/linux_x86_64/lib/ \
-ltensorflow-lite -ldl
}
# TensorFlow Lite - Android - armv7a
android {
QT += androidextras
LIBS += -L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/c \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/core/api \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/kernels \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/kernels/internal \
-L$$TENSORFLOW_PATH/bazel-bin/external/androidndk \
-L$$TENSORFLOW_PATH/bazel-bin/external/farmhash_archive \
-L$$TENSORFLOW_PATH/bazel-bin/external/fft2d \
-L$$TENSORFLOW_PATH/bazel-bin/external/flatbuffers \
-lframework -larena_planner -lsimple_memory_arena -lutil -lapi -lc_api_internal \
-lbuiltin_ops -lbuiltin_op_kernels -lkernel_util -leigen_support -lgemm_support \
-laudio_utils -lkernel_utils -ltensor_utils -lneon_tensor_utils -lquantization_util \
-llstm_eval -lstring_util -lcpufeatures -lfarmhash -lfft2d -lflatbuffers
}
# TensorFlow Lite - iOS - Universal library
ios {
LIBS += -L$$TFLITE_MAKE_PATH/gen/lib/ \
-framework Accelerate \
-ltensorflow-lite
}
Then I built it up in the following project environment:
Qt Creator 4.11.2
Android NDK 20.1.5948944
Android SDK 26.1.1
Compiler Clang Qt 5.13.2 for Android ARMv7
JVM java-8-oracle
The result was failed.
Error:
/home/user/FelgoProjects/TensorFlowLiteQtVPlay/tensorflow/tensorflow/lite/delegates/nnapi/nnapi_delegate.h:23: error: 'absl/types/optional.h' file not found
#include "absl/types/optional.h"
I would like to know how to build up and include Tensorflow library for Qt project.
EDITED:
I edited .pro file to add libraries:
# TensorFlow Lite - Global
TENSORFLOW_PATH = $$PWD/tensorflow/
TFLITE_MAKE_PATH = $$TENSORFLOW_PATH/tensorflow/lite/tools/make
INCLUDEPATH += $$TENSORFLOW_PATH \
$$TFLITE_MAKE_PATH/downloads/ \
$$TFLITE_MAKE_PATH/downloads/eigen \
$$TFLITE_MAKE_PATH/downloads/gemmlowp \
$$TFLITE_MAKE_PATH/downloads/neon_2_sse \
$$TFLITE_MAKE_PATH/downloads/farmhash/src \
$$TFLITE_MAKE_PATH/downloads/flatbuffers/include
# TensorFlow Lite - Android - armv7a
android {
QT += androidextras
LIBS += -L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/c \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/core/api \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/kernels \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/kernels/internal \
-L$$TENSORFLOW_PATH/bazel-bin/tensorflow/lite/nnapi \
-L$$TENSORFLOW_PATH/bazel-bin/external/androidndk \
-L$$TENSORFLOW_PATH/bazel-bin/external/farmhash_archive \
-L$$TENSORFLOW_PATH/bazel-bin/external/fft2d \
-L$$TENSORFLOW_PATH/bazel-bin/external/flatbuffers \
-L$$TENSORFLOW_PATH/bazel-bin/external/flatbuffers/src \
-L$$TENSORFLOW_PATH/bazel-bin/external/ruy/ruy \
-L$$TENSORFLOW_PATH/bazel-bin/external/ruy/ruy/profiler \
-lallocation.pic -larena_planner.pic -larena_planner.pic -lminimal_logging.pic \
-lsimple_memory_arena.pic -lstring_util.pic -lutil.pic \
-lapi.pic -lbuiltin_op_kernels.pic -lbuiltin_ops.pic -lcpu_backend_context.pic -lcpu_backend_gemm.pic -leigen_support.pic \
-lkernel_util.pic -llstm_eval.pic -laudio_utils.pic -lkernel_utils.pic -lneon_tensor_utils.pic \
-lportable_tensor_utils.pic -ltensor_utils.pic -lquantization_util.pic -ltranspose_utils.pic \
-lfarmhash.pic -lfft2d.pic -lflatbuffers.pic \
-lallocator.pic -lapply_multiplier.pic -lblocking_counter.pic -lblock_map.pic -lcontext.pic -lcontext_get_ctx.pic \
-lctx.pic -ldetect_arm.pic -ldetect_x86.pic -lhave_built_path_for_avx2.pic -lhave_built_path_for_avx512.pic \
-lhave_built_path_for_avxvnni.pic -lhave_built_path_for_sse42.pic -lkernel_arm.pic -lkernel_avx2.pic \
-lkernel_avx512.pic -lkernel_avxvnni.pic -lkernel_sse42.pic -lpack_arm.pic -lpack_avx2.pic -lpack_avx512.pic \
-lpack_avxvnni.pic -lpack_sse42.pic -lprepacked_cache.pic -lthread_pool.pic -ltrace.pic -ltrmul.pic \
-ltune.pic -lwait.pic -linstrumentation.pic -lnnapi_implementation.pic -lnnapi_util.pic
}
There are some errors after building.
tensorflow/lite/util.cc:47: error: undefined reference to 'TfLiteIntArrayCreate'
tensorflow/lite/util.cc:47: error: undefined reference to 'TfLiteIntArrayCreate'
tensorflow/lite/kernels/activations.cc:265: error: undefined reference to 'TfLiteIntArrayCopy'
tensorflow/lite/kernels/activations.cc:291: error: undefined reference to 'TfLiteIntArrayCopy'
tensorflow/lite/kernels/activations.cc:380: error: undefined reference to 'TfLiteIntArrayCopy'
tensorflow/lite/kernels/activations.cc:612: error: undefined reference to 'TfLiteIntArrayCopy'
tensorflow/lite/kernels/activations.cc:729: error: undefined reference to 'TfLiteTypeGetName'
tensorflow/lite/kernels/activations.cc:757: error: undefined reference to 'TfLiteTypeGetName'
tensorflow/lite/kernels/activations.cc:840: error: undefined reference to 'TfLiteTypeGetName'
tensorflow/lite/kernels/activations.cc:1084: error: undefined reference to 'TfLiteTypeGetName'
tensorflow/lite/kernels/arg_min_max.cc:40: error: undefined reference to 'TfLiteIntArrayCreate'
tensorflow/lite/kernels/arg_min_max.cc:40: error: undefined reference to 'TfLiteIntArrayCreate'
tensorflow/lite/kernels/basic_rnn.cc:104: error: undefined reference to 'TfLiteIntArrayFree'
tensorflow/lite/kernels/basic_rnn.cc:110: error: undefined reference to 'TfLiteIntArrayEqual'
tensorflow/lite/kernels/basic_rnn.cc:120: error: undefined reference to 'TfLiteIntArrayEqual'
tensorflow/lite/kernels/basic_rnn.cc:133: error: undefined reference to 'TfLiteIntArrayEqualsArray'
tensorflow/lite/kernels/basic_rnn.cc:144: error: undefined reference to 'TfLiteIntArrayEqualsArray'
tensorflow/lite/kernels/basic_rnn.cc:157: error: undefined reference to 'TfLiteIntArrayEqualsArray'
tensorflow/lite/kernels/basic_rnn.cc:168: error: undefined reference to 'TfLiteIntArrayEqualsArray'
tensorflow/lite/kernels/batch_matmul.cc:108: error: undefined reference to 'TfLiteIntArrayFree'
tensorflow/lite/kernels/bidirectional_sequence_lstm.cc:527: error: undefined reference to 'TfLiteIntArrayFree'
tensorflow/lite/kernels/bidirectional_sequence_lstm.cc:527: error: undefined reference to 'TfLiteIntArrayFree'
tensorflow/lite/kernels/bidirectional_sequence_lstm.cc:630: error: undefined reference to 'TfLiteIntArrayEqual'
tensorflow/lite/kernels/bidirectional_sequence_lstm.cc:642: error: undefined reference to 'TfLiteIntArrayEqual'
./tensorflow/lite/kernels/internal/reference/densify.h:36: error: undefined reference to 'tflite::optimize::sparsity::FormatConverter<float>::FormatConverter(std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&, TfLiteSparsity const&)'
./tensorflow/lite/kernels/internal/reference/densify.h:38: error: undefined reference to 'tflite::optimize::sparsity::FormatConverter<float>::SparseToDense(float const*)'
./tensorflow/lite/kernels/internal/reference/densify.h:36: error: undefined reference to 'tflite::optimize::sparsity::FormatConverter<signed char>::FormatConverter(std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&, TfLiteSparsity const&)'
./tensorflow/lite/kernels/internal/reference/densify.h:38: error: undefined reference to 'tflite::optimize::sparsity::FormatConverter<signed char>::SparseToDense(signed char const*)'
tensorflow/lite/kernels/embedding_lookup_sparse.cc:178: error: undefined reference to 'TfLiteTensorRealloc'
tensorflow/lite/kernels/expand_dims.cc:105: error: undefined reference to 'TfLiteTensorRealloc'
./tensorflow/lite/kernels/internal/reference/sparse_ops/fully_connected.h:35: error: undefined reference to 'tflite::optimize::sparsity::FormatConverter<float>::FormatConverter(std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&, TfLiteSparsity const&)'
./tensorflow/lite/kernels/internal/reference/sparse_ops/fully_connected.h:37: error: undefined reference to 'tflite::optimize::sparsity::FormatConverter<float>::SparseToDense(float const*)'
tensorflow/lite/kernels/if.cc:85: error: undefined reference to 'tflite::impl::Subgraph::ResizeInputTensor(int, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&)'
tensorflow/lite/kernels/if.cc:92: error: undefined reference to 'tflite::impl::Subgraph::AllocateTensors()'
tensorflow/lite/kernels/if.cc:85: error: undefined reference to 'tflite::impl::Subgraph::ResizeInputTensor(int, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&)'
tensorflow/lite/kernels/if.cc:92: error: undefined reference to 'tflite::impl::Subgraph::AllocateTensors()'
tensorflow/lite/kernels/if.cc:155: error: undefined reference to 'tflite::impl::Subgraph::Invoke()'
tensorflow/lite/kernels/reshape.cc:156: error: undefined reference to 'TfLiteTensorRealloc'
tensorflow/lite/kernels/while.cc:152: error: undefined reference to 'tflite::impl::Subgraph::AllocateTensors()'
tensorflow/lite/kernels/while.cc:170: error: undefined reference to 'tflite::impl::Subgraph::AllocateTensors()'
tensorflow/lite/kernels/while.cc:57: error: undefined reference to 'tflite::impl::Subgraph::ResizeInputTensor(int, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&)'
tensorflow/lite/kernels/while.cc:267: error: undefined reference to 'tflite::impl::Subgraph::Invoke()'
tensorflow/lite/kernels/while.cc:292: error: undefined reference to 'tflite::impl::Subgraph::Invoke()'
tensorflow/lite/kernels/while.cc:57: error: undefined reference to 'tflite::impl::Subgraph::ResizeInputTensor(int, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&)'
tensorflow/lite/kernels/register.cc:34: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int)'
tensorflow/lite/kernels/register.cc:35: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int)'
tensorflow/lite/kernels/register.cc:36: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int, int)'
tensorflow/lite/kernels/register.cc:38: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int)'
tensorflow/lite/kernels/register.cc:39: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int, int)'
tensorflow/lite/kernels/register.cc:41: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int, int)'
tensorflow/lite/kernels/register.cc:43: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int, int)'
tensorflow/lite/kernels/register.cc:52: error: undefined reference to 'tflite::MutableOpResolver::AddBuiltin(tflite::BuiltinOperator, TfLiteRegistration const*, int)'
tensorflow/lite/kernels/register.cc:291: error: undefined reference to 'tflite::MutableOpResolver::AddCustom(char const*, TfLiteRegistration const*, int)'
tensorflow/lite/kernels/register.cc:294: error: undefined reference to 'tflite::MutableOpResolver::AddCustom(char const*, TfLiteRegistration const*, int)'
tensorflow/lite/kernels/register.cc:295: error: undefined reference to 'tflite::MutableOpResolver::AddCustom(char const*, TfLiteRegistration const*, int)'
tensorflow/lite/kernels/register.cc:297: error: undefined reference to 'tflite::MutableOpResolver::AddCustom(char const*, TfLiteRegistration const*, int)'
external/androidndk/ndk/sources/cxx-stl/llvm-libc++/include/unordered_map:0: error: undefined reference to 'vtable for tflite::MutableOpResolver'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
./tensorflow/lite/kernels/register.h:0: error: undefined reference to 'vtable for tflite::MutableOpResolver'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
/home/sergey/FelgoProjects/TensorFlowLiteQtVPlay/tensorflow//bazel-bin/tensorflow/lite/kernels/libbuiltin_ops.pic.a(register.pic.o):register.cc:vtable for tflite::ops::builtin::BuiltinOpResolver: error: undefined reference to 'tflite::MutableOpResolver::FindOp(tflite::BuiltinOperator, int) const'
/home/sergey/FelgoProjects/TensorFlowLiteQtVPlay/tensorflow//bazel-bin/tensorflow/lite/kernels/libbuiltin_ops.pic.a(register.pic.o):register.cc:vtable for tflite::ops::builtin::BuiltinOpResolver: error: undefined reference to 'tflite::MutableOpResolver::FindOp(char const*, int) const'
/home/sergey/FelgoProjects/TensorFlowLiteQtVPlay/tensorflow//bazel-bin/tensorflow/lite/kernels/libbuiltin_ops.pic.a(register.pic.o):register.cc:typeinfo for tflite::ops::builtin::BuiltinOpResolver: error: undefined reference to 'typeinfo for tflite::MutableOpResolver'
../../Felgo/Felgo/android_armv7/include/QtQml/qqml.h:0: error: undefined reference to 'ObjectsRecogFilter::staticMetaObject'
../../Felgo/Felgo/android_armv7/include/QtQml/qqml.h:0: error: undefined reference to 'ObjectsRecogFilter::staticMetaObject'
../TensorFlowLiteQtVPlay/auxutils.h:0: error: undefined reference to 'vtable for AuxUtils'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../../Felgo/Felgo/android_armv7/include/QtCore/qmetatype.h:0: error: undefined reference to 'ObjectsRecogFilter::staticMetaObject'
../../Felgo/Felgo/android_armv7/include/QtCore/qmetatype.h:0: error: undefined reference to 'ObjectsRecogFilter::staticMetaObject'
../TensorFlowLiteQtVPlay/objectsrecogfilter.h:0: error: undefined reference to 'vtable for ObjectsRecogFilter'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../TensorFlowLiteQtVPlay/tensorflowthread.h:0: error: undefined reference to 'vtable for TensorflowThread'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../TensorFlowLiteQtVPlay/tensorflowthread.h:0: error: undefined reference to 'vtable for WorkerTF'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../TensorFlowLiteQtVPlay/tensorflow/tensorflow/lite/mutable_op_resolver.h:0: error: undefined reference to 'vtable for tflite::MutableOpResolver'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
/home/sergey/android-ndk-r20b/sources/cxx-stl/llvm-libc++/include/memory:2339: error: undefined reference to 'tflite::FlatBufferModel::~FlatBufferModel()'
/home/sergey/android-ndk-r20b/sources/cxx-stl/llvm-libc++/include/memory:2339: error: undefined reference to 'tflite::impl::Interpreter::~Interpreter()'
main.o:main.cpp:vtable for QQmlPrivate::QQmlElement<ObjectsRecogFilter>: error: undefined reference to 'ObjectsRecogFilter::metaObject() const'
main.o:main.cpp:vtable for QQmlPrivate::QQmlElement<ObjectsRecogFilter>: error: undefined reference to 'ObjectsRecogFilter::qt_metacast(char const*)'
main.o:main.cpp:vtable for QQmlPrivate::QQmlElement<ObjectsRecogFilter>: error: undefined reference to 'ObjectsRecogFilter::qt_metacall(QMetaObject::Call, int, void**)'
main.o:main.cpp:typeinfo for QQmlPrivate::QQmlElement<ObjectsRecogFilter>: error: undefined reference to 'typeinfo for ObjectsRecogFilter'
../TensorFlowLiteQtVPlay/objectsrecogfilter.cpp:16: error: undefined reference to 'ObjectsRecogFilter::initializedChanged(bool const&)'
../TensorFlowLiteQtVPlay/objectsrecogfilter.cpp:0: error: undefined reference to 'vtable for ObjectsRecogFilter'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../TensorFlowLiteQtVPlay/objectsrecogfilter.cpp:161: error: undefined reference to 'ObjectsRecogFilter::runTensorFlow(QImage)'
../TensorFlowLiteQtVPlay/objectsrecogfilter.cpp:300: error: undefined reference to 'ObjectsRecogFilter::initializedChanged(bool const&)'
../TensorFlowLiteQtVPlay/objectsrecogfilter.cpp:248: error: undefined reference to 'ObjectsRecogFilter::initializedChanged(bool const&)'
../TensorFlowLiteQtVPlay/objectsrecogfilter.cpp:276: error: undefined reference to 'ObjectsRecogFilter::initializedChanged(bool const&)'
../TensorFlowLiteQtVPlay/tensorflowthread.cpp:16: error: undefined reference to 'WorkerTF::results(int, QStringList, QList<double>, QList<QRectF>, double)'
../TensorFlowLiteQtVPlay/tensorflowthread.cpp:17: error: undefined reference to 'WorkerTF::finished()'
../TensorFlowLiteQtVPlay/tensorflowthread.cpp:0: error: undefined reference to 'vtable for TensorflowThread'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../TensorFlowLiteQtVPlay/tensorflowthread.cpp:47: error: undefined reference to 'TensorflowThread::results(int, QStringList, QList<double>, QList<QRectF>, double)'
../TensorFlowLiteQtVPlay/tensorflowthread.h:0: error: undefined reference to 'vtable for WorkerTF'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:109: error: undefined reference to 'tflite::FlatBufferModel::BuildFromFile(char const*, tflite::ErrorReporter*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:118: error: undefined reference to 'tflite::impl::InterpreterBuilder::InterpreterBuilder(tflite::FlatBufferModel const&, tflite::OpResolver const&)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:121: error: undefined reference to 'tflite::impl::InterpreterBuilder::operator()(std::__ndk1::unique_ptr<tflite::impl::Interpreter, std::__ndk1::default_delete<tflite::impl::Interpreter> >*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:128: error: undefined reference to 'tflite::impl::Interpreter::UseNNAPI(bool)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:131: error: undefined reference to 'tflite::impl::Interpreter::SetNumThreads(int)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:136: error: undefined reference to 'tflite::impl::Interpreter::AllocateTensors()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:166: error: undefined reference to 'tflite::impl::InterpreterBuilder::~InterpreterBuilder()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:166: error: undefined reference to 'tflite::impl::InterpreterBuilder::~InterpreterBuilder()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:272: error: undefined reference to 'tflite::impl::Interpreter::Invoke()'
../TensorFlowLiteQtVPlay/tensorflow/tensorflow/lite/stderr_reporter.h:0: error: undefined reference to 'vtable for tflite::StderrReporter'
/home/sergey/android-ndk-r20b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:316: error: undefined reference to 'tflite::DefaultErrorReporter()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:316: error: undefined reference to 'tflite::impl::Interpreter::Interpreter(tflite::ErrorReporter*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:321: error: undefined reference to 'tflite::impl::Interpreter::AddTensors(int, int*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:324: error: undefined reference to 'tflite::impl::Interpreter::AddTensors(int, int*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:327: error: undefined reference to 'tflite::impl::Interpreter::SetInputs(std::__ndk1::vector<int, std::__ndk1::allocator<int> >)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:328: error: undefined reference to 'tflite::impl::Interpreter::SetOutputs(std::__ndk1::vector<int, std::__ndk1::allocator<int> >)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:337: error: undefined reference to 'tflite::MutableOpResolver::FindOp(tflite::BuiltinOperator, int) const'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:340: error: undefined reference to 'tflite::impl::Interpreter::AddNodeWithParameters(std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&, char const*, unsigned int, void*, TfLiteRegistration const*, int*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:341: error: undefined reference to 'tflite::impl::Interpreter::AllocateTensors()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:354: error: undefined reference to 'tflite::impl::Interpreter::Invoke()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:316: error: undefined reference to 'tflite::DefaultErrorReporter()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:316: error: undefined reference to 'tflite::impl::Interpreter::Interpreter(tflite::ErrorReporter*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:321: error: undefined reference to 'tflite::impl::Interpreter::AddTensors(int, int*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:324: error: undefined reference to 'tflite::impl::Interpreter::AddTensors(int, int*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:327: error: undefined reference to 'tflite::impl::Interpreter::SetInputs(std::__ndk1::vector<int, std::__ndk1::allocator<int> >)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:328: error: undefined reference to 'tflite::impl::Interpreter::SetOutputs(std::__ndk1::vector<int, std::__ndk1::allocator<int> >)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:337: error: undefined reference to 'tflite::MutableOpResolver::FindOp(tflite::BuiltinOperator, int) const'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:340: error: undefined reference to 'tflite::impl::Interpreter::AddNodeWithParameters(std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&, char const*, unsigned int, void*, TfLiteRegistration const*, int*)'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:341: error: undefined reference to 'tflite::impl::Interpreter::AllocateTensors()'
../TensorFlowLiteQtVPlay/tensorflowlite.cpp:354: error: undefined reference to 'tflite::impl::Interpreter::Invoke()'
../TensorFlowLiteQtVPlay/tensorflow/tensorflow/lite/interpreter.h:178: error: undefined reference to 'tflite::impl::Interpreter::SetTensorParametersReadWrite(int, TfLiteType, char const*, unsigned int, int const*, TfLiteQuantizationParams, bool, unsigned int, int const*)'
tensorflow/lite/string_util.cc:108: error: undefined reference to 'TfLiteTensorReset'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libTensorFlowLiteQtVPlay.so] Error 1
I am the author of this tutorial. Could you try to compile TensorFlow with libstdc++ by using this command as described in the tutorial:
bazel build --cxxopt='--std=c++11' -c opt --config=android_arm tensorflow/lite/java:libtensorflowlite_jni
Maybe your problem is related to mixing libc++ and libstdc++, Qt uses libstdc++ and you are compiling TensorFlow with libc++ in your bazel command.
Let me know if this helps.
OpenCV version = 3.1.0
Dlib version = 19.1
Android NDK version = r21
I would like to build lib.so file for Android Studio by using Android NDK. However, it failed in the SharedLibrary and OpenCV involved in all errors. I checked my directory path and it does not have any mistake. Can anyone tell help me?
This is the tutorial that I followed: https://www.youtube.com/watch?v=ZjZHiPWBiYY&t=2192s
Application.mk:
NDK_TOOLCHAIN_VERSION := clang
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS := -std=c++11 -frtti -fexceptions
APP_PLATFORM := android-16
APP_STL := c++_static
Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := dlib
LOCAL_C_INCLUDES := $(LOCAL_PATH)/dlib
LOCAL_SRC_FILES += \
../$(LOCAL_PATH)/dlib//dlib/threads/threads_kernel_shared.cpp \
../$(LOCAL_PATH)/dlib/dlib/entropy_decoder/entropy_decoder_kernel_2.cpp \
../$(LOCAL_PATH)/dlib/dlib/base64/base64_kernel_1.cpp \
../$(LOCAL_PATH)/dlib/dlib/threads/threads_kernel_1.cpp \
../$(LOCAL_PATH)/dlib/dlib/threads/threads_kernel_2.cpp
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
include $(BUILD_STATIC_LIBRARY)
TOP_LEVEL_PATH := $(abspath $(LOCAL_PATH)/..)
$(info TOP Level Path: $(TOP_LEVEL_PATH))
EXT_INSTALL_PATH = $(TOP_LEVEL_PATH)/third_party
OPENCV_PATH = $(EXT_INSTALL_PATH)/opencv/jni
OPENCV_INCLUDE_DIR = $(OPENCV_PATH)/include
include $(CLEAR_VARS)
OpenCV_INSTALL_MODULES := on
OPENCV_CAMERA_MODULES := off
OPENCV_LIB_TYPE := STATIC
include $(OPENCV_PATH)/OpenCV.mk
LOCAL_MODULE := MyLibs
LOCAL_C_INCLUDES += \
$(OPENCV_INCLUDE_DIR)
LOCAL_SRC_FILES := com_example_opencvdlib_NativeClass.cpp
LOCAL_LDLIBS += -lm -llog -ldl -lz -ljnigraphics
LOCAL_CPPFLAGS += -fexceptions -frtti -std=c++11
LOCAL_STATIC_LIBRARIES += dlib
include $(BUILD_SHARED_LIBRARY)
Errors:
C:\Users\leech\Desktop\AndroidApp\generateLibs>ndk-build
TOP Level Path: C:/Users/leech/Desktop/AndroidApp/generateLibs
TOP Level Path: C:/Users/leech/Desktop/AndroidApp/generateLibs
TOP Level Path: C:/Users/leech/Desktop/AndroidApp/generateLibs
TOP Level Path: C:/Users/leech/Desktop/AndroidApp/generateLibs
[armeabi-v7a] Compile++ thumb: MyLibs <= com_example_opencvdlib_NativeClass.cpp
jni/com_example_opencvdlib_NativeClass.cpp:6:2: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
[armeabi-v7a] Compile++ thumb: dlib <= threads_kernel_shared.cpp
[armeabi-v7a] Compile++ thumb: dlib <= entropy_decoder_kernel_2.cpp
[armeabi-v7a] Compile++ thumb: dlib <= base64_kernel_1.cpp
[armeabi-v7a] Compile++ thumb: dlib <= threads_kernel_1.cpp
[armeabi-v7a] Compile++ thumb: dlib <= threads_kernel_2.cpp
[armeabi-v7a] StaticLibrary : libdlib.a
[armeabi-v7a] SharedLibrary : libMyLibs.so
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_imgproc.a(drawing.cpp.o):drawing.cpp:function std::vector<cv::PolyEdge, std::allocator<cv::PolyEdge> >::reserve(unsigned int): error: undefined reference to 'std::__throw_length_error(char const*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_imgproc.a(drawing.cpp.o):drawing.cpp:function std::vector<cv::Point_<int>, std::allocator<cv::Point_<int> > >::_M_fill_insert(__gnu_cxx::__normal_iterator<cv::Point_<int>*, std::vector<cv::Point_<int>, std::allocator<cv::Point_<int> > > >, unsigned int, cv::Point_<int> const&): error: undefined reference to 'std::__throw_length_error(char const*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_imgproc.a(drawing.cpp.o):drawing.cpp:function std::vector<CvSeq, std::allocator<CvSeq> >::_M_fill_insert(__gnu_cxx::__normal_iterator<CvSeq*, std::vector<CvSeq, std::allocator<CvSeq> > >, unsigned int, CvSeq const&): error: undefined reference to 'std::__throw_length_error(char const*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_imgproc.a(drawing.cpp.o):drawing.cpp:function std::vector<CvSeqBlock, std::allocator<CvSeqBlock> >::_M_fill_insert(__gnu_cxx::__normal_iterator<CvSeqBlock*, std::vector<CvSeqBlock, std::allocator<CvSeqBlock> > >, unsigned int, CvSeqBlock const&): error: undefined reference to 'std::__throw_length_error(char const*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function _GLOBAL__sub_I_system.cpp: error: undefined reference to 'std::ios_base::Init::Init()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(system.cpp.o):system.cpp:function _GLOBAL__sub_I_system.cpp: error: undefined reference to 'std::ios_base::Init::~Init()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) [clone .part.39]: error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf(): error: undefined reference to 'vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf(): error: undefined reference to 'vtable for std::basic_streambuf<char, std::char_traits<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<float>(cv::Mat const&): error: undefined reference to 'std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<float>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<float>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<float>(cv::Mat const&): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<float>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_streambuf<char, std::char_traits<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<float>(cv::Mat const&): error: undefined reference to 'VTT for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<float>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ios<char, std::char_traits<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<double>(cv::Mat const&): error: undefined reference to 'std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<double>(cv::Mat const&): error: undefined reference to 'std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<double>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<double>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<double>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ios<char, std::char_traits<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<unsigned short>(cv::Mat const&): error: undefined reference to 'std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<unsigned short>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<unsigned short>(cv::Mat const&): error: undefined reference to 'VTT for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<unsigned short>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ios<char, std::char_traits<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<short>(cv::Mat const&): error: undefined reference to 'std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<short>(cv::Mat const&): error: undefined reference to 'std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<short>(cv::Mat const&): error: undefined reference to 'std::ios_base::~ios_base()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<short>(cv::Mat const&): error: undefined reference to 'std::ostream::operator<<(short)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<short>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<short>(cv::Mat const&): error: undefined reference to 'VTT for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::string cv::ocl::kerToStr<short>(cv::Mat const&): error: undefined reference to 'vtable for std::basic_ios<char, std::char_traits<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::OpenCLBufferPoolBaseImpl<cv::ocl::OpenCLBufferPoolImpl, cv::ocl::CLBufferEntry, _cl_mem*>::setMaxReservedSize(unsigned int): error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::OpenCLBufferPoolBaseImpl<cv::ocl::OpenCLBufferPoolImpl, cv::ocl::CLBufferEntry, _cl_mem*>::setMaxReservedSize(unsigned int): error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::OpenCLBufferPoolBaseImpl<cv::ocl::OpenCLBufferPoolImpl, cv::ocl::CLBufferEntry, _cl_mem*>::release(_cl_mem*): error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::OpenCLBufferPoolBaseImpl<cv::ocl::OpenCLBufferPoolImpl, cv::ocl::CLBufferEntry, _cl_mem*>::release(_cl_mem*): error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::OpenCLBufferPoolBaseImpl<cv::ocl::OpenCLBufferPoolImpl, cv::ocl::CLBufferEntry, _cl_mem*>::release(_cl_mem*): error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::kernelToStr(cv::_InputArray const&, int, char const*): error: undefined reference to 'std::string::_Rep::_M_dispose(std::allocator<char> const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::Kernel::set(int, cv::ocl::Image2D const&): error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::vector<std::string, std::allocator<std::string> >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, std::string const&): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::vector<std::string, std::allocator<std::string> >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, std::string const&): error: undefined reference to 'std::string::_Rep::_M_dispose(std::allocator<char> const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::vector<std::string, std::allocator<std::string> >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, std::string const&): error: undefined reference to 'std::string::_Rep::_M_dispose(std::allocator<char> const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::vector<std::string, std::allocator<std::string> >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, std::string const&): error: undefined reference to 'std::string::_Rep::_M_dispose(std::allocator<char> const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'std::ios_base::ios_base()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned int, unsigned int)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'VTT for std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::split(std::string const&, char, std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'vtable for std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
C:/android-ndk-r21/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::_Rb_tree<cv::ocl::Context::Impl::HashKey, std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program>, std::_Select1st<std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program> >, std::less<cv::ocl::Context::Impl::HashKey>, std::allocator<std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program> > >::_M_insert_unique(std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program> const&): error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function std::_Rb_tree<cv::ocl::Context::Impl::HashKey, std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program>, std::_Select1st<std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program> >, std::less<cv::ocl::Context::Impl::HashKey>, std::allocator<std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program> > >::_M_insert_unique(std::pair<cv::ocl::Context::Impl::HashKey const, cv::ocl::Program> const&): error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function int cv::ocl::getStringInfo<int (*)(_cl_platform_id*, unsigned int, unsigned int, void*, unsigned int*), _cl_platform_id*>(int (*)(_cl_platform_id*, unsigned int, unsigned int, void*, unsigned int*), _cl_platform_id*, unsigned int, std::string&) [clone .constprop.272]: error: undefined reference to 'std::string::_M_mutate(unsigned int, unsigned int, unsigned int)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function int cv::ocl::getStringInfo<int (*)(_cl_platform_id*, unsigned int, unsigned int, void*, unsigned int*), _cl_platform_id*>(int (*)(_cl_platform_id*, unsigned int, unsigned int, void*, unsigned int*), _cl_platform_id*, unsigned int, std::string&) [clone .constprop.272]: error: undefined reference to 'std::string::assign(char const*, unsigned int)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::OpenCLBufferPoolBaseImpl<cv::ocl::OpenCLBufferPoolImpl, cv::ocl::CLBufferEntry, _cl_mem*>::_findAndRemoveEntryFromReservedList(cv::ocl::CLBufferEntry&, unsigned int): error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::Context::Impl::setDefault(): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::Context::Impl::setDefault(): error: undefined reference to 'std::string::find(char const*, unsigned int, unsigned int) const'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function cv::ocl::OpenCLBufferPoolImpl::_allocateBufferEntry(cv::ocl::CLBufferEntry&, unsigned int): error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function _GLOBAL__sub_I_ocl.cpp: error: undefined reference to 'std::ios_base::Init::Init()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function _GLOBAL__sub_I_ocl.cpp: error: undefined reference to 'std::ios_base::Init::~Init()'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function tbb::internal::handle_perror(int, char const*): error: undefined reference to 'std::runtime_error::runtime_error(std::string const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function tbb::internal::throw_exception_v4(tbb::internal::exception_id): error: undefined reference to 'std::runtime_error::runtime_error(std::string const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function tbb::internal::throw_exception_v4(tbb::internal::exception_id): error: undefined reference to 'std::runtime_error::runtime_error(std::string const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function tbb::internal::throw_exception_v4(tbb::internal::exception_id): error: undefined reference to 'std::runtime_error::runtime_error(std::string const&)'
C:/Users/leech/Desktop/AndroidApp/generateLibs/third_party/opencv/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function tbb::internal::throw_exception_v4(tbb::internal::exception_id): error: undefined reference to 'std::invalid_argument::invalid_argument(std::string const&)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [C:/android-ndk-r21/build//../build/core/build-binary.mk:725: obj/local/armeabi-v7a/libMyLibs.so] Error 1
Can anyone tell me what have I did wrong?
I'm trying to compile LLVM/Clang 8.0.1 for Android with Cmake (since autotools i used before are no longer supported) on mac.
I'm using https://github.com/llvm/llvm-project.git.
In build dir i'm using the following configure script (followed manuals):
cmake ../llvm \
-DCMAKE_INSTALL_PREFIX=/Users/asmirnov/Library/Android/llvm_android_arm \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_THREADS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="ARM;X86" \
-DLIBCLANG_BUILD_STATIC=ON \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_ZLIB=OFF \
\
-DCMAKE_CROSSCOMPILING=True \
-DLLVM_TABLEGEN=/Users/asmirnov/Library/Android/llvm/bin/llvm-tblgen \
-DCLANG_TABLEGEN=/Users/asmirnov/Documents/dev/src/llvm-project/build/bin/clang-tblgen \
-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf \
-DLLVM_TARGET_ARCH=ARM \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_ENABLE_PIC=False \
-DCMAKE_TOOLCHAIN_FILE=/Users/asmirnov/Library/Android/ndk/android-ndk-r20/build/cmake/android.toolchain.cmake
As you can see i'm using CMake toolchain file from Android NDK (20).
Also i've compiled it locally and passing LLVM_TABLEGEN and CLANG_TABLEGEN.
Configuration went successfully, but during the build i get the following errors:
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:27: error: undefined reference to 'llvm::Pass::~Pass()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:33: error: undefined reference to 'llvm::errs()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:34: error: undefined reference to 'llvm::errs()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:34: error: undefined reference to 'llvm::Value::getName() const'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:34: error: undefined reference to 'llvm::raw_ostream::write_escaped(llvm::StringRef, bool)'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/include/llvm/Support/raw_ostream.h:149: error: undefined reference to 'llvm::raw_ostream::write(unsigned char)'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/include/llvm/Support/raw_ostream.h:174: error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned int)'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:45: error: undefined reference to 'llvm::Pass::~Pass()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:51: error: undefined reference to 'llvm::errs()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:52: error: undefined reference to 'llvm::errs()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:52: error: undefined reference to 'llvm::Value::getName() const'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/lib/Transforms/Hello/Hello.cpp:52: error: undefined reference to 'llvm::raw_ostream::write_escaped(llvm::StringRef, bool)'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/include/llvm/PassSupport.h:98: error: undefined reference to 'llvm::PassRegistry::getPassRegistry()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/include/llvm/PassSupport.h:98: error: undefined reference to 'llvm::PassRegistry::registerPass(llvm::PassInfo const&, bool)'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/include/llvm/PassSupport.h:98: error: undefined reference to 'llvm::PassRegistry::getPassRegistry()'
/Users/asmirnov/Documents/dev/src/llvm-project/llvm/include/llvm/PassSupport.h:98: error: undefined reference to 'llvm::PassRegistry::registerPass(llvm::PassInfo const&, bool)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::~Pass()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::getPassName() const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::print(llvm::raw_ostream&, llvm::Module const*) const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::FunctionPass::createPrinterPass(llvm::raw_ostream&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::FunctionPass::assignPassManager(llvm::PMStack&, llvm::PassManagerType)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::preparePassManager(llvm::PMStack&)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::FunctionPass::getPotentialPassManagerType() const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::getAnalysisUsage(llvm::AnalysisUsage&) const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::releaseMemory()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::getAdjustedAnalysisPointer(void const*)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::getAsImmutablePass()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::getAsPMDataManager()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::verifyAnalysis() const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello: error: undefined reference to 'llvm::Pass::dumpPassStructure(unsigned int)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::~Pass()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::getPassName() const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::print(llvm::raw_ostream&, llvm::Module const*) const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::FunctionPass::createPrinterPass(llvm::raw_ostream&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::FunctionPass::assignPassManager(llvm::PMStack&, llvm::PassManagerType)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::preparePassManager(llvm::PMStack&)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::FunctionPass::getPotentialPassManagerType() const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::releaseMemory()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::getAdjustedAnalysisPointer(void const*)'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::getAsImmutablePass()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::getAsPMDataManager()'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::verifyAnalysis() const'
CMakeFiles/LLVMHello.dir/Hello.cpp.o:Hello.cpp:vtable for (anonymous namespace)::Hello2: error: undefined reference to 'llvm::Pass::dumpPassStructure(unsigned int)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/LLVMHello.so] Error 1
make[1]: *** [lib/Transforms/Hello/CMakeFiles/LLVMHello.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Am i doing anything wrong? Is it LLVM/Clang bug? Any workaround?
I don't know if this is your only problem, but this is definitely wrong and could cause Clang to not find the right libraries:
-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf
Android is arm-linux-androideabi$API_LEVEL. arm-linux-gnueabihf is a GNU/Linux target.
Yup, this requires some work arounds similar to this. Also use -DLLVM_DEFAULT_TARGET_TRIPLE="armv7a-linux-androideabi"
Can you help me, please?
I am doing the next changes to support c++11 with opencv 3 in android NDK:
I change from APP_STL := gnustl_static to APP_STL := c++_static
Application.mk
APP_STL := c++_static
APP_CPPFLAGS := -std=c++11 -frtti -fexceptions
APP_ABI := armeabi armeabi-v7a mips x86 arm64-v8a x86_64 mips64
APP_PLATFORM := android-14
# use this to select gcc instead of clang
NDK_TOOLCHAIN_VERSION := 4.9
Android.mk
LOCAL_PATH := $(call my-dir)
LOCAL_PATH_LIB_DIR:=library/lib/classifier
include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES:=off
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=SHARED
include ../../../OpenCV-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE:= detection_based_tracker
LOCAL_SRC_FILES := DetectionBasedTracker_jni.cpp \
library/jniUtils.cpp \
${ LOCAL_PATH_LIB_DIR}/logic.cpp \
${ LOCAL_PATH_LIB_DIR}/logic2.cpp \
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_LDLIBS += -llog -ldl -lm -latomic -L$(LOCAL_PATH)/libs/armeabi
- L$(LOCAL_PATH)/libs/armeabi-v7a -L$(LOCAL_PATH)/libs/mips
-L$(LOCAL_PATH)/libs/x86 -L$(LOCAL_PATH)/libs/arm64-v8a
-L$(LOCAL_PATH)/libs/mips64
-L$(LOCAL_PATH)/libs/x86_64
LOCAL_CPPFLAGS += -ljnigraphics -D_LINUX -DBOOST_HAS_PTHREADS -fexceptions -std=c++11
-I$(LOCAL_PATH)/ -I$(LOCAL_PATH)/library/lib/pico/ I
LOCAL_CPP_FEATURES := exceptions rtti
APP_OPTIM := debug
include $(BUILD_SHARED_LIBRARY)
When I compile the Android app with Android NDK r10e. I have the next errores in the Log:
' [armeabi-v7a] SharedLibrary : libdetection_based_tracker.so
/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++
-Wl,-soname,libdetection_based_tracker.so -shared --sysroot=/android/sdk/ndk-bundle/platforms/android-8/arch-arm ./obj/local/armeabi-v7a/objs/detection_based_tracker/DetectionBasedTracker_jni.o
./obj/local/armeabi-v7a/objs/detection_based_tracker/detection-manager/jniUtils.o
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/liblibpng.a
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/liblibtiff.a
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/liblibjasper.a
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libIlmImf.a
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a
/android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/thumb/libc++_static.a
-lgcc -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -L/android/sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib -lz -ldl -lm -llog -llog -ldl -lm -latomic -Ljni/libs/armeabi -Ljni/libs/armeabi-v7a -Ljni/libs/mips -Ljni/libs/x86 -Ljni/libs/arm64-v8a -Ljni/libs/mips64 -Ljni/libs/x86_64 -lc -lm -o ./obj/local/armeabi-v7a/libdetection_based_tracker.so
jni/detection-manager/lib/pico/uniqueness2.cpp:240: error: undefined
reference to 'cv::DescriptorMatcher::match(cv::_InputArray const&,
cv::_InputArray const&, std::__1::vector >&, cv::_InputArray const&) const'
jni/detection-manager/lib/pico/motiondetector.cpp:77: error: undefined
reference to 'cv::Subdiv2D::insert(std::__1::vector,
std::__1::allocator > > const&)'
jni/detection-manager/lib/counting-blobs/jniUtils.cpp:995: error:
undefined reference to 'cv::imwrite(cv::String const&, cv::_InputArray
const&, std::__1::vector > const&)'
jni/detection-manager/lib/counting-blobs/jniUtils.cpp:996: error:
undefined reference to 'cv::imwrite(cv::String const&, cv::_InputArray
const&, std::__1::vector > const&)'
jni/detection-manager/lib/counting-blobs/jniUtils.cpp:1004: error:
undefined reference to 'cv::imwrite(cv::String const&, cv::_InputArray
const&, std::__1::vector > const&)'
jni/detection-manager/lib/counting-blobs/jniUtils.cpp:1005: error:
undefined reference to 'cv::imwrite(cv::String const&, cv::_InputArray
const&, std::__1::vector > const&)'
jni/detection-manager/lib/counting-blobs/jniUtils.cpp:1153: error:
undefined reference to
'cv::DescriptorMatcher::knnMatch(cv::_InputArray const&,
cv::_InputArray const&, std::__1::vector >,
std::__1::allocator > > >&, int, cv::_InputArray const&,
bool) const'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
cv::LBPEvaluator::setWindow(cv::Point_, int): error: undefined
reference to 'std::__throw_out_of_range(char const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
cv::HaarEvaluator::setWindow(cv::Point_, int): error: undefined
reference to 'std::__throw_out_of_range(char const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
cv::HaarEvaluator::computeChannels(int, cv::_InputArray const&):
error: undefined reference to 'std::__throw_out_of_range(char const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
cv::LBPEvaluator::computeChannels(int, cv::_InputArray const&): error:
undefined reference to 'std::__throw_out_of_range(char const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
std::vector >::resize(unsigned int, int):
error: undefined reference to 'std::__throw_length_error(char const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
std::vector >::resize(unsigned int,
double): error: undefined reference to 'std::__throw_length_error(char
const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
std::vector >::reserve(unsigned int):
error: undefined reference to 'std::__throw_length_error(char const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_objdetect.a(cascadedetect.cpp.o):cascadedetect.cpp:function
std::vector
::reserve(unsigned int): error: undefined reference to 'std::__throw_length_error(char const*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_flann.a(miniflann.cpp.o):miniflann.cpp:function
cvflann::LshIndex >::getNeighbors(float const*,
cvflann::ResultSet&): error: undefined reference to
'std::__throw_bad_cast()'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_flann.a(miniflann.cpp.o):miniflann.cpp:function
cvflann::LshIndex >::getNeighbors(float const*,
cvflann::ResultSet&): error: undefined reference to 'std::cerr'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_flann.a(miniflann.cpp.o):miniflann.cpp:function
std::_Rb_tree > >,
std::_Select1st > > >, std::less,
std::allocator > > >
::_M_insert_unique_(std::_Rb_tree_const_iterator > >
, std::pair > > const&): error: undefined reference
to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_flann.a(miniflann.cpp.o):miniflann.cpp:function
cvflann::AutotunedIndex >::buildIndex(): error:
undefined reference to 'std::basic_ostringstream, std::allocator
::basic_ostringstream(std::_Ios_Openmode)' ../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_flann.a(miniflann.cpp.o):miniflann.cpp:function
cvflann::AutotunedIndex >::buildIndex(): error:
undefined reference to 'std::basic_stringbuf, std::allocator >::str() const' .
/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld:
the vtable symbol may be undefined because the class is missing its
key function
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_flann.a(miniflann.cpp.o):miniflann.cpp:function
cvflann::AutotunedIndex >::buildIndex(): error:
undefined reference to 'vtable for std::basic_stringbuf, std::allocator >'
/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld:
the vtable symbol may be undefined because the class is missing its
key function
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
std::basic_stringbuf,
std::allocator >::~basic_stringbuf(): error: undefined reference
to 'vtable for std::basic_streambuf >'
/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld:
the vtable symbol may be undefined because the class is missing its
key function
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
std::basic_stringbuf,
std::allocator >::~basic_stringbuf(): error: undefined reference
to 'std::locale::~locale()'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
std::basic_stringbuf,
std::allocator >::~basic_stringbuf(): error: undefined reference
to 'std::string::_Rep::_S_empty_rep_storage'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
std::basic_stringbuf,
std::allocator >::~basic_stringbuf(): error: undefined reference
to 'vtable for std::basic_stringbuf,
std::allocator >'
/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld:
the vtable symbol may be undefined because the class is missing its
key function
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
std::basic_stringbuf,
std::allocator >::~basic_stringbuf(): error: undefined reference
to 'vtable for std::basic_streambuf >'
/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld:
the vtable symbol may be undefined because the class is missing its
key function
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
std::string cv::ocl::kerToStr(cv::Mat const&): error: undefined
reference to 'std::basic_ostringstream,
std::allocator >::basic_ostringstream(std::_Ios_Openmode)' .
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::find(char const*, unsigned int, unsigned int) const'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::_M_leak_hard()'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::basic_string, std::allocator
::basic_string(char const*, std::allocator const&)' ../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::basic_string, std::allocator
::basic_string(char const*, std::allocator const&)' ../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::basic_string, std::allocator
::basic_string(char const*, std::allocator const&)' ../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::_M_leak_hard()'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::_M_leak_hard()'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::_M_leak_hard()'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::compare(char const*) const'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::compare(char const*) const'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::compare(char const*) const'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::find(char const*, unsigned int, unsigned int) const'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::compare(char const*) const'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::basic_ostream >& std::endl >(std::basic_ostream >&)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::basic_ostream >& std::endl >(std::basic_ostream >&)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::basic_ostream >& std::endl >(std::basic_ostream >&)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::basic_ostream >& std::endl >(std::basic_ostream >&)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::assign(std::string const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::Context::Impl::setDefault(): error: undefined reference to
'std::string::assign(std::string const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_core.a(ocl.cpp.o):ocl.cpp:function
cv::ocl::OpenCLBufferPoolImpl::_allocateBufferEntry(cv::ocl::CLBufferEntry&,
unsigned int): error: undefined reference to
'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libIlmImf.a(half.cpp.o):half.cpp:function
operator>>(std::istream&, half&): error: undefined reference to
'std::istream& std::istream::_M_extract(float&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libIlmImf.a(ImfChannelList.cpp.o):ImfChannelList.cpp:function
Imf::ChannelList::operator[](char const*): error: undefined reference
to 'std::basic_stringstream,
std::allocator >::basic_stringstream(std::_Ios_Openmode)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libIlmImf.a(ImfChannelList.cpp.o):ImfChannelList.cpp:function
Imf::ChannelList::operator[](char const*): error: undefined reference
to 'std::basic_stringstream,
std::allocator >::~basic_stringstream()' .
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::out_of_range::out_of_range(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::range_error::range_error(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::range_error::range_error(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::runtime_error::runtime_error(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::runtime_error::runtime_error(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::out_of_range::out_of_range(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::out_of_range::out_of_range(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to
'std::invalid_argument::invalid_argument(std::string const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::length_error::length_error(std::string
const&)'
../../../OpenCV-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi-v7a/libtbb.a(tbb_misc.cpp.o):tbb_misc.cpp:function
tbb::internal::throw_exception_v4(tbb::internal::exception_id): error:
undefined reference to 'std::out_of_range::out_of_range(std::string
const&)' collect2: error: ld returned 1 exit status make: ***
[obj/local/armeabi-v7a/libdetection_based_tracker.so] Error 1
I'm trying to compile and deploy ceres solver into an Android project.
I successfully compiled ceres (1.8.0 and 1.9.0, tried both), running ndk-build from the ceres jni folder.
Then, I use QtCreator to compile and deploy and Android project. It fails with the following error:
B:\Android\android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ --sysroot=B:\Android\android-ndk-r10e/platforms/android-9/arch-arm/ -Wl,-soname,libtest_3rdparty_inprg_ceres.so -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libtest_3rdparty_inprg_ceres.so main.obj logging.obj -LB:\Android\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -LB:\Android\android-ndk-r10e/platforms/android-9/arch-arm//usr/lib -lb:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/lib/android_armeabi-v7a/gcc-4.8/libceres.a -LC:/Qt/5.5/android_armv7/lib -lQt5Widgets -Lc:\utils\android\ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a -Lc:\utils\android\ndk/platforms/android-9/arch-arm//usr/lib -lQt5Gui -lQt5Core -lGLESv2 -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/memory:3639: error: undefined reference to 'std::__1::__shared_weak_count::~__shared_weak_count()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/memory:4448: error: undefined reference to 'std::__1::__shared_weak_count::__release_shared()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__1::ios_base::clear(unsigned int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/memory:4154: error: undefined reference to 'std::__1::__shared_weak_count::__add_shared()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/memory:4154: error: undefined reference to 'std::__1::__shared_weak_count::__add_shared()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__1::ios_base::getloc() const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__1::locale::use_facet(std::__1::locale::id&) const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__1::locale::~locale()'
B:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/jni/../internal/ceres/solver_impl.cc:123: error: undefined reference to 'std::__1::cout'
B:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/jni/../internal/ceres/solver_impl.cc:123: error: undefined reference to 'std::__1::ctype<char>::id'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__1::ios_base::getloc() const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__1::locale::use_facet(std::__1::locale::id&) const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__1::locale::~locale()'
B:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/jni/../internal/ceres/solver_impl.cc:158: error: undefined reference to 'std::__1::cout'
B:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/jni/../internal/ceres/solver_impl.cc:158: error: undefined reference to 'std::__1::ctype<char>::id'
b:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/lib/android_armeabi-v7a/gcc-4.8/libceres.a(solver_impl.o):solver_impl.cc:vtable for std::__1::__shared_ptr_pointer<ceres::OrderedGroups<double*>*, std::__1::default_delete<ceres::OrderedGroups<double*> >, std::__1::allocator<ceres::OrderedGroups<double*> > >: error: undefined reference to 'std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:508: error: undefined reference to 'std::__1::ios_base::getloc() const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__1::locale::use_facet(std::__1::locale::id&) const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:508: error: undefined reference to 'std::__1::locale::~locale()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__1::ios_base::getloc() const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__1::locale::use_facet(std::__1::locale::id&) const'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__1::locale::~locale()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__1::ios_base::clear(unsigned int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:520: error: undefined reference to 'std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::id'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:520: error: undefined reference to 'std::__1::ctype<char>::id'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__1::ios_base::init(void*)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:370: error: undefined reference to 'std::__1::locale::locale()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__hash_table:1944: error: undefined reference to 'std::__1::__next_prime(unsigned int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__hash_table:1955: error: undefined reference to 'std::__1::__next_prime(unsigned int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__hash_table:1944: error: undefined reference to 'std::__1::__next_prime(unsigned int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/__hash_table:1955: error: undefined reference to 'std::__1::__next_prime(unsigned int)'
b:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/lib/android_armeabi-v7a/gcc-4.8/libceres.a(schur_eliminator.o):schur_eliminator.cc:vtable for ceres::internal::SchurEliminator<2, 4, 8>: error: undefined reference to 'ceres::internal::SchurEliminator<2, 4, 8>::~SchurEliminator()'
b:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/lib/android_armeabi-v7a/gcc-4.8/libceres.a(schur_eliminator.o):schur_eliminator.cc:vtable for ceres::internal::SchurEliminator<2, 4, 8>: error: undefined reference to 'ceres::internal::SchurEliminator<2, 4, 8>::~SchurEliminator()'
b:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/lib/android_armeabi-v7a/gcc-4.8/libceres.a(schur_eliminator.o):schur_eliminator.cc:vtable for ceres::internal::SchurEliminator<2, 4, 8>: error: undefined reference to 'ceres::internal::SchurEliminator<2, 4, 8>::Init(int, ceres::internal::CompressedRowBlockStructure const*)'
b:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/lib/android_armeabi-v7a/gcc-4.8/libceres.a(schur_eliminator.o):schur_eliminator.cc:vtable for ceres::internal::SchurEliminator<2, 4, 8>: error: undefined reference to 'ceres::internal::SchurEliminator<2, 4, 8>::Eliminate(ceres::internal::BlockSparseMatrix const*, double const*, double const*, ceres::internal::BlockRandomAccessMatrix*, double*)'
b:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/lib/android_armeabi-v7a/gcc-4.8/libceres.a(schur_eliminator.o):schur_eliminator.cc:vtable for ceres::internal::SchurEliminator<2, 4, 8>: error: undefined reference to 'ceres::internal::SchurEliminator<2, 4, 8>::BackSubstitute(ceres::internal::BlockSparseMatrix const*, double const*, double const*, double const*, double*)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3077: error: undefined reference to 'std::__1::__rs_get()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:2912: error: undefined reference to 'std::__1::__rs_default::operator()()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:2912: error: undefined reference to 'std::__1::__rs_default::operator()()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3083: error: undefined reference to 'std::__1::__rs_default::~__rs_default()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3077: error: undefined reference to 'std::__1::__rs_get()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:2912: error: undefined reference to 'std::__1::__rs_default::operator()()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:2912: error: undefined reference to 'std::__1::__rs_default::operator()()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3083: error: undefined reference to 'std::__1::__rs_default::~__rs_default()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3077: error: undefined reference to 'std::__1::__rs_get()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3083: error: undefined reference to 'std::__1::__rs_default::~__rs_default()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3077: error: undefined reference to 'std::__1::__rs_get()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:3083: error: undefined reference to 'std::__1::__rs_default::~__rs_default()'
B:/dev/vobs_ext/libcpp/ceres/ceres-solver-1.9.0/jni/../internal/ceres/partitioned_matrix_view.cc:118: error: undefined reference to 'ceres::internal::PartitionedMatrixView<2, 4, 8>::PartitionedMatrixView(ceres::internal::BlockSparseMatrix const&, int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__1::ios_base::~ios_base()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__1::ios_base::clear(unsigned int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:370: error: undefined reference to 'std::__1::locale::locale()'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__1::ios_base::clear(unsigned int)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:494: error: undefined reference to 'std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::id'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:494: error: undefined reference to 'std::__1::ctype<char>::id'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:728: error: undefined reference to 'std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::id'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:676: error: undefined reference to 'std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::id'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__1::ios_base::init(void*)'
B:/Android/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__1::ios_base::init(void*)'
collect2.exe: error: ld returned 1 exit status
makefile:82: recipe for target 'libtest_3rdparty_inprg_ceres.so' failed
mingw32-make: *** [libtest_3rdparty_inprg_ceres.so] Error 1
13:17:13: Le processus "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" s'est terminé avec le code 2.
Erreur lors de la compilation/déploiement du projet test_3rdparty_inprg_ceres (kit : Android for armeabi-v7a (GCC 4.9, Qt 5.5.0))
When executing step "Make"
13:17:13: Temps écoulé : 00:08.
I'm wondering if this could be due to ceres linking with c++ libraries statically, while my program links then dynamically....but have no clue how to solve this.
All libraries in your app SHOULD use the same STL runtime. But speaking about static libraries, they MUST use the same STL configuration. If you did not change cerces-solver/jni/Application.mk, it will expect APP_STL=c++_static. You can override this to use APP_STL=c++_shared, but you need a very good reason to change the way this external library is built. Much easier to switch your program to APP_STL=c++_static.
Edited by jpo38:
There are actually other things to be changed to have libceres.so be generated instead of libceres.a:
Add LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog in Android.mk
Replace include $(BUILD_STATIC_LIBRARY) by include $(BUILD_SHARED_LIBRARY) in Android.mk
Add -DCERES_BUILDING_SHARED_LIBRARY and -DCERES_RESTRICT_SCHUR_SPECIALIZATION (dunno why this second one helps, looks like Shur stuff does not like shared linkage) to LOCAL_CFLAGS in Android.mk
Then, the dynamic library is generated and may be used.