mardi 27 novembre 2018

Could I make a project with specific STL and linked to it a shared library which was compiled with another STL ?

I have a whole project, which runs with c++_static. Within this project, a one of the library is "Opencv", popular library.

This is c++ content compiled for android, she works with static linking without any Optimizations like VPVF3 Or NEON (best).

Then, after viewing a lot of articles/forums, I've seen that Opencv need optimizations on ARM If we want to make a several calculus by opencv.

To do that, I've compiled successfully Opencv (3.4.4) with NEON optimizations.

But when I want to link it in my project, I have a few undefined references, such as :

error: undefined reference to 'cv::read(cv::FileNode const&, std::__ndk1::vector

&)' error: undefined reference to 'cv::write(cv::FileStorage&, cv::String const&, std::__ndk1::vector > const&)' error: undefined reference to 'cv::KeyPointsFilter::retainBest(std::__ndk1::vector >&, int)' error: undefined reference to 'cv::read(cv::FileNode const&, std::__ndk1::basic_string, std::__ndk1::allocator >&, std::__ndk1::basic_string, std::__ndk1::allocator > const&)' error: undefined reference to 'cv::KeyPointsFilter::retainBest(std::__ndk1::vector >&, int)' error: undefined reference to 'cv::KeyPointsFilter::retainBest(std::__ndk1::vector >&, int)' error: undefined reference to 'cv::DescriptorMatcher::knnMatch(cv::_InputArray const&, cv::_InputArray const&, std::__ndk1::vector >, std::__ndk1::allocator > > >&, int, cv::_InputArray const&, bool) const' error: undefined reference to 'cv::DescriptorMatcher::knnMatch(cv::_InputArray const&, cv::_InputArray const&, std::__ndk1::vector >, std::__ndk1::allocator > > >&, int, cv::_InputArray const&, bool) const' error: undefined reference to 'cv::KeyPointsFilter::retainBest(std::__ndk1::vector >&, int)' error: undefined reference to 'cv::DescriptorMatcher::knnMatch(cv::_InputArray const&, cv::_InputArray const&, std::__ndk1::vector >, std::__ndk1::allocator > > >&, int, cv::_InputArray const&, bool) const' error: undefined reference to 'cv::DescriptorMatcher::knnMatch(cv::_InputArray const&, cv::_InputArray const&, std::__ndk1::vector >, std::__ndk1::allocator > > >&, int, cv::_InputArray const&, bool) const' error: undefined reference to 'cv::drawKeypoints(cv::_InputArray const&, std::__ndk1::vector const&, cv::InputOutputArray const&, cv::Scalar const&, int)' clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

Information -->

  • With Opencv without optimizations she was linked with static libraries with same ANDROID STL than the project (c++_static).

  • But until now I have never ever good happened when i would want to compile Opencv with NEON and c++_static, however with "gnustl_static" she's compiled perfectly.

RESUME INFORMATION :

without NEON --> STATIC LIB (c++_static). with NEON --> SHARED LIB (gnustl_static), why ?

Because, If I want to link these Opencv libs with NEON without the same STL, she must need to link with shared lib, I have seen that you can link a shared lib with other STL it will not create any problem, by the way that's my question.

Could I make a project with stl(c++_static) and linked to it a shared lib with stl(gnustl_static) ?

If you have any idea, I will be very grateful and you'll be very helpful !

Aucun commentaire:

Enregistrer un commentaire