Ask Your Question
0

Error from STL library while compiling for Android with APP_STD=c++_static(shared)

asked 2018-09-02 21:30:57 -0600

monxarat gravatar image

updated 2018-09-02 21:35:09 -0600

Hi guys, How to fix bellow error.

When I compiling APP_STD with c++_static. Bellow error has occurred.

Application.mk
APP_STL := c++_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a armeabi arm64-v8a
APP_PLATFORM := android-18

error: undefined reference to 'cv::DescriptorMatcher::match(cv::_InputArray const&, cv::_InputArray const&, std::__ndk1::vector<cv::DMatch, std::__ndk1::allocator<cv::DMatch> >&, cv::_InputArray const&) const'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Above Error when I called the method.

Ptr<FlannBasedMatcher> matcher = FlannBasedMatcher::create();
vector< DMatch > matches;
 matcher->match(objectDescriptor, sceneDescriptor, matches);

If I compiling with gnustl_static, then some methods of the C++ have not solved: copy_if, accumulate, minmax_element,..etc,...

I have using NDK 17 or 16 same error has occurred.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-09-02 23:59:42 -0600

monxarat gravatar image

I have solved this issue by way: In Application.mk config like bellow.

APP_STL := gnustl_static
...
APP_CPPFLAGS := -std=c++11

And in Android.mk

LOCAL_CPPFLAGS += -std=c++11
edit flag offensive delete link more

Comments

if it's solved, be so kind, and close your issue here , then.

berak gravatar imageberak ( 2018-09-03 00:54:55 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-09-02 21:30:57 -0600

Seen: 416 times

Last updated: Sep 02 '18