Ask Your Question

Revision history [back]

Native compilation failed

I try use this sample for import openCV sdk to project. I try to port sample from OpenCV sample pack for android. Sample is "face-detection" Everything compiles now except of native code.

From sample I have following function

#include "DetectionBasedTracker_jni.h"
#include "opencv2/core/core.hpp"
#include "o

pencv2/contrib/detection_based_tracker.hpp"

#include <string>
#include <vector>

#include <android/log.h>
#include <jni.h>

...

JNIEXPORT jlong JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_nativeCreateObject
(JNIEnv * jenv, jclass, jstring jFileName, jint faceSize)
{
    LOGD("Java_org_opencv_samples_facedetect_DetectionBasedTracker_nativeCreateObject enter");
    const char* jnamestr = jenv->GetStringUTFChars(jFileName, NULL);
    string stdFileName(jnamestr);
    jlong result = 0;
    try
    {
        DetectionBasedTracker::Parameters DetectorParams;
        if (faceSize > 0)
            DetectorParams.minObjectSize = faceSize;
        result = (jlong) new DetectionBasedTracker(stdFileName, DetectorParams);
    }
    catch(cv::Exception& e)
    {
        LOGD("nativeCreateObject caught cv::Exception: %s", e.what());
        jclass je = jenv->FindClass("org/opencv/core/CvException");
        if(!je)
            je = jenv->FindClass("java/lang/Exception");
        jenv->ThrowNew(je, e.what());
    }
    catch (...)
    {
        LOGD("nativeCreateObject caught unknown exception");
        jclass je = jenv->FindClass("java/lang/Exception");
        jenv->ThrowNew(je, "Unknown exception in JNI code of DetectionBasedTracker.nativeCreateObject()");
        return 0;
    }

    LOGD("Java_org_opencv_samples_facedetect_DetectionBasedTracker_nativeCreateObject exit");
    return result;
}

but it does not compile with next error

/llvm-libc++/libs/x86/libandroid_support.a" && :
/Users/busylee/temp/opencv/from-github/app/src/main/cpp/DetectionBasedTracker_jni.cpp:30: error: undefined reference to 'DetectionBasedTracker::DetectionBasedTracker(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, DetectionBasedTracker::Parameters const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86
```
and full error log
```
Build command failed.
Error while executing process /Users/busylee/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/busylee/temp/opencv/from-github/app/.externalNativeBuild/cmake/debug/x86 --target detection_based_tracker}
[1/2] Building CXX object CMakeFiles/detection_based_tracker.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o
[2/2] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/x86/libdetection_based_tracker.so
FAILED: : && /Users/busylee/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++  --target=i686-none-linux-android --gcc-toolchain=/Users/busylee/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/busylee/Library/Android/sdk/ndk-bundle/sysroot -fPIC -isystem /Users/busylee/Library/Android/sdk/ndk-bundle/sysroot/usr/include/i686-linux-android -D__ANDROID_API__=15 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -frtti -fexceptions -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /Users/busylee/Library/Android/sdk/ndk-bundle/platforms/android-15/arch-x86 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -L/Users/busylee/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86 -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libdetection_based_tracker.so -o ../../../../build/intermediates/cmake/debug/obj/x86/libdetection_based_tracker.so CMakeFiles/detection_based_tracker.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o  -llog /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_androidcamera.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_flann.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_imgproc.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_highgui.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_features2d.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_calib3d.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_photo.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_video.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_videostab.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_ts.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_ml.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_ocl.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_superres.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_stitching.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_legacy.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_photo.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_ocl.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_calib3d.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_features2d.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_flann.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_video.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_ml.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_highgui.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_androidcamera.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_imgproc.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/3rdparty/libs/x86/liblibjpeg.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/3rdparty/libs/x86/liblibpng.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/3rdparty/libs/x86/liblibtiff.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/3rdparty/libs/x86/liblibjasper.a /Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/3rdparty/libs/x86/libIlmImf.a -lz -ldl -lm -llog -ldl -lm -llog -latomic -lm "/Users/busylee/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libc++_static.a" "/Users/busylee/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libc++abi.a" "/Users/busylee/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libandroid_support.a" && :
/Users/busylee/temp/opencv/from-github/app/src/main/cpp/DetectionBasedTracker_jni.cpp:30: error: undefined reference to 'DetectionBasedTracker::DetectionBasedTracker(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, DetectionBasedTracker::Parameters const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::reserve(unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::append(char const*, unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::append(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::append(char const*, unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(DetectionBasedTracker&, std::string const&): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector(): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector(): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::DetectionBasedTracker(std::string const&, DetectionBasedTracker::Parameters const&): error: undefined reference to 'std::string::reserve(unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::DetectionBasedTracker(std::string const&, DetectionBasedTracker::Parameters const&): error: undefined reference to 'std::string::append(char const*, unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::DetectionBasedTracker(std::string const&, DetectionBasedTracker::Parameters const&): error: undefined reference to 'std::string::append(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::DetectionBasedTracker(std::string const&, DetectionBasedTracker::Parameters const&): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function DetectionBasedTracker::DetectionBasedTracker(std::string const&, DetectionBasedTracker::Parameters const&): error: undefined reference to 'std::string::append(char const*, unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_contrib.a(detection_based_tracker.cpp.o):/build/2_4_pack-android/opencv/modules/contrib/src/detection_based_tracker.cpp:function std::vector<int, std::allocator<int> >::_M_fill_insert(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, unsigned int, int const&): error: undefined reference to 'std::__throw_length_error(char const*)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function cv::CascadeClassifier::Data::read(cv::FileNode const&): error: undefined reference to 'std::string::compare(char const*) const'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function cv::CascadeClassifier::Data::read(cv::FileNode const&): error: undefined reference to 'std::string::compare(char const*) const'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function cv::CascadeClassifier::Data::read(cv::FileNode const&): error: undefined reference to 'std::string::compare(char const*) const'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function cv::CascadeClassifier::Data::read(cv::FileNode const&): error: undefined reference to 'std::string::compare(char const*) const'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function cv::FileNode::operator std::string() const: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function cv::FileNode::operator std::string() const: error: undefined reference to 'std::string::assign(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function std::vector<cv::CascadeClassifier::Data::Stage, std::allocator<cv::CascadeClassifier::Data::Stage> >::reserve(unsigned int): error: undefined reference to 'std::__throw_length_error(char const*)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function std::vector<cv::CascadeClassifier::Data::DTree, std::allocator<cv::CascadeClassifier::Data::DTree> >::reserve(unsigned int): error: undefined reference to 'std::__throw_length_error(char const*)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_objdetect.a(cascadedetect.cpp.o):/build/2_4_pack-android/opencv/modules/objdetect/src/cascadedetect.cpp:function std::vector<cv::CascadeClassifier::Data::DTreeNode, std::allocator<cv::CascadeClassifier::Data::DTreeNode> >::reserve(unsigned int): error: undefined reference to 'std::__throw_length_error(char const*)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_imgproc.a(color.cpp.o):/build/2_4_pack-android/opencv/modules/imgproc/src/color.cpp:function global constructors keyed to a: error: undefined reference to 'std::ios_base::Init::Init()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_imgproc.a(color.cpp.o):/build/2_4_pack-android/opencv/modules/imgproc/src/color.cpp:function global constructors keyed to a: error: undefined reference to 'std::ios_base::Init::~Init()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_imgproc.a(imgwarp.cpp.o):/build/2_4_pack-android/opencv/modules/imgproc/src/imgwarp.cpp:function global constructors keyed to a: error: undefined reference to 'std::ios_base::Init::Init()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_imgproc.a(imgwarp.cpp.o):/build/2_4_pack-android/opencv/modules/imgproc/src/imgwarp.cpp:function global constructors keyed to a: error: undefined reference to 'std::ios_base::Init::~Init()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(system.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/system.cpp:function cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(system.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::string::assign(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(system.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/system.cpp:function cv::Exception::formatMessage(): error: undefined reference to 'std::string::assign(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(system.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/system.cpp:function cv::getBuildInformation(): error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(system.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/system.cpp:function cv::tempfile(char const*): error: undefined reference to 'std::string::assign(char const*, unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(system.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/system.cpp:function cv::tempfile(char const*): error: undefined reference to 'std::string::_M_leak_hard()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(system.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/system.cpp:function cv::tempfile(char const*): error: undefined reference to 'std::string::assign(char const*, unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::DeviceInfo::query(): error: undefined reference to 'std::string::assign(std::string const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::cerr'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::ostream::operator<<(int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function cv::gpu::error(char const*, char const*, int, char const*): error: undefined reference to 'std::ostream::flush()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function global constructors keyed to a: error: undefined reference to 'std::ios_base::Init::Init()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(gpumat.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/gpumat.cpp:function global constructors keyed to a: error: undefined reference to 'std::ios_base::Init::~Init()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(persistence.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/persistence.cpp:function cv::toUtf16(std::string const&): error: undefined reference to 'std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_empty_rep_storage'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(persistence.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/persistence.cpp:function cv::toUtf16(std::string const&): error: undefined reference to 'std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(persistence.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/persistence.cpp:function icvClose(CvFileStorage*, std::string*): error: undefined reference to 'std::string::_M_mutate(unsigned int, unsigned int, unsigned int)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(persistence.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/persistence.cpp:function icvClose(CvFileStorage*, std::string*): error: undefined reference to 'std::string::resize(unsigned int, char)'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(persistence.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/persistence.cpp:function icvClose(CvFileStorage*, std::string*): error: undefined reference to 'std::string::_M_leak_hard()'
/Users/busylee/temp/opencv/from-github/android-opencv/opencv/src/sdk/native/libs/x86/libopencv_core.a(persistence.cpp.o):/build/2_4_pack-android/opencv/modules/core/src/persistence.cpp:function cv::FileStorage::releaseAndGetString(): error: undefined reference to 'std::string::reserve(unsigned int)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

I tried to add following line

include_directories("../android-opencv/opencv/src/sdk/native/jni/include/")

but nothing changed, error still occurs. Do you have any ideas?