mtcnn android

 

这个带facenet

https://github.com/cayden/facesample

 

这个有摄像头

https://github.com/HLinShan/andorid_mtcnn_facenet

 

glsurfaceview,出来是白屏

https://download.csdn.net/download/weixin_42713739/11081627

https://github.com/moli232777144/mtcnn_ncnn.git

编译android时报错:
Error while executing process D:\android-sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build G:\mtcnn_ncnn\mtcnn_AS\app.externalNativeBuild\cmake\debug\armeabi-v7a --target mtcnn}
[1/3] Building CXX object CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn_jni.cpp.o
[2/3] Building CXX object CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn.cpp.o
[3/3] Linking CXX shared library ........\build\intermediates\cmake\debug\obj\armeabi-v7a\libmtcnn.so
FAILED: cmd.exe /C "cd . && D:\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi --gcc-toolchain=D:/android-sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 --sysroot=D:/android-sdk/ndk-bundle/sysroot -fPIC -isystem D:/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=17 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -fopenmp -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -std=c++11 -frtti -fexceptions -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot D:/android-sdk/ndk-bundle/platforms/android-17/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -LD:/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libmtcnn.so -o ........\build\intermediates\cmake\debug\obj\armeabi-v7a\libmtcnn.so CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn.cpp.o CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn_jni.cpp.o ../../../../src/main/jniLibs/armeabi-v7a/libncnn.a -ljnigraphics -lz -llog -latomic -lm "D:/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_static.a" "D:/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++abi.a" "D:/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libandroid_support.a" "D:/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a" "-ldl" && cd ."
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::~Net(): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::~Net(): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::~Net(): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::~Net(): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::clear(): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::clear(): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::string::assign(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::string::assign(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::string::compare(char const*) const'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::string::assign(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::string::assign(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::load_param(__sFILE*): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::find_blob_index_by_name(char const*) const: error: undefined reference to 'std::string::compare(char const*) const'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Net::find_layer_index_by_name(char const*) const: error: undefined reference to 'std::string::compare(char const*) const'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function ncnn::Extractor::input(char const*, ncnn::Mat const&): error: undefined reference to 'std::string::compare(char const*) const'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<ncnn::layer_registry_entry, std::allocatorncnn::layer_registry_entry >::_M_fill_insert(__gnu_cxx::__normal_iterator<ncnn::layer_registry_entry*, std::vector<ncnn::layer_registry_entry, std::allocatorncnn::layer_registry_entry > >, unsigned int, ncnn::layer_registry_entry const&): error: undefined reference to 'std::__throw_length_error(char const*)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<ncnn::Layer*, std::allocatorncnn::Layer* >::_M_fill_insert(__gnu_cxx::__normal_iterator<ncnn::Layer**, std::vector<ncnn::Layer*, std::allocatorncnn::Layer* > >, unsigned int, ncnn::Layer* const&): error: undefined reference to 'std::__throw_length_error(char const*)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<ncnn::Blob, std::allocatorncnn::Blob >::_M_fill_insert(__gnu_cxx::__normal_iterator<ncnn::Blob*, std::vector<ncnn::Blob, std::allocatorncnn::Blob > >, unsigned int, ncnn::Blob const&): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<ncnn::Blob, std::allocatorncnn::Blob >::_M_fill_insert(__gnu_cxx::__normal_iterator<ncnn::Blob*, std::vector<ncnn::Blob, std::allocatorncnn::Blob > >, unsigned int, ncnn::Blob const&): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<ncnn::Blob, std::allocatorncnn::Blob >::_M_fill_insert(__gnu_cxx::__normal_iterator<ncnn::Blob*, std::vector<ncnn::Blob, std::allocatorncnn::Blob > >, unsigned int, ncnn::Blob const&): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<ncnn::Blob, std::allocatorncnn::Blob >::_M_fill_insert(__gnu_cxx::__normal_iterator<ncnn::Blob*, std::vector<ncnn::Blob, std::allocatorncnn::Blob > >, unsigned int, ncnn::Blob const&): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string const&)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<ncnn::Blob, std::allocatorncnn::Blob >::_M_fill_insert(__gnu_cxx::__normal_iterator<ncnn::Blob*, std::vector<ncnn::Blob, std::allocatorncnn::Blob > >, unsigned int, ncnn::Blob const&): error: undefined reference to 'std::__throw_length_error(char const*)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):/home/nihui/osd/ncnn/src/net.cpp:function std::vector<int, std::allocator >::_M_fill_insert(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator > >, unsigned int, int const&): error: undefined reference to 'std::__throw_length_error(char const*)'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

后来来这个网址重新下载了库文件,

https://github.com/Tencent/ncnn/releases

后来又报错了,解决方法参考网址:

https://www.jianshu.com/p/f7a7a8765294

 

解决方案一 转换成Androidx

  1. 将build tools更新到3.2.0,gradle更新到4.6,依赖库统一更新到28.0.0,这一步非常重要,否则会导致第二步不能完全转换成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI算法网奇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值