Open h3clikejava opened 4 years ago
应该是cmake编译没过吧,可以看一下选没选ndk,Build-->Clean Project一下然后选Build-->Refreash Linked C++ Projects试试,另外这个报错是全部的报错吗?
还是会报错
Build command failed. Error while executing process /Users/hewanchao/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /Users/hewanchao/Downloads/MTCNN_facenet_Android-master/app/.cxx/cmake/debug/armeabi-v7a charleyszcFace} ninja: Entering directory `/Users/hewanchao/Downloads/MTCNN_facenet_Android-master/app/.cxx/cmake/debug/armeabi-v7a' [1/6] Building CXX object CMakeFiles/charleyszcFace.dir/src/main/cpp/FaceNet.cpp.o ../../../../src/main/cpp/FaceNet.cpp:31:13: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] threadNum = threadNum;
../../../../src/main/cpp/FaceNet.cpp:50:45: warning: unused variable 'square' [-Wunused-variable]
double ret = 0.0, mod1 = 0.0, mod2 = 0.0, square = 0.0, result = 0.0;
^
2 warnings generated.
[2/6] Building CXX object CMakeFiles/charleyszcFace.dir/src/main/cpp/Liveness.cpp.o
In file included from ../../../../src/main/cpp/Liveness.cpp:4:
../../../../src/main/cpp/Liveness.h:25:17: warning: private field 'mean_vals' is not used [-Wunused-private-field]
const float mean_vals[3] = {104.f, 117.f, 123.f};
^
../../../../src/main/cpp/Liveness.h:26:9: warning: private field 'img_w' is not used [-Wunused-private-field]
int img_w, img_h;
^
../../../../src/main/cpp/Liveness.h:26:16: warning: private field 'img_h' is not used [-Wunused-private-field]
int img_w, img_h;
^
3 warnings generated.
[3/6] Building CXX object CMakeFiles/charleyszcFace.dir/src/main/cpp/FaceAlign.cpp.o
[4/6] Building CXX object CMakeFiles/charleyszcFace.dir/src/main/cpp/FaceEngine_jni.cpp.o
../../../../src/main/cpp/FaceEngine_jni.cpp:359:16: warning: implicit conversion of NULL constant to 'jboolean' (aka 'unsigned char') [-Wnull-conversion]
return NULL;
~~~~~~ ^~~~
'\0'
1 warning generated.
[5/6] Building CXX object CMakeFiles/charleyszcFace.dir/src/main/cpp/detecte.cpp.o
../../../../src/main/cpp/detecte.cpp:331:9: warning: unused variable 'count' [-Wunused-variable]
int count = 0;
^
1 warning generated.
[6/6] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libcharleyszcFace.so
FAILED: ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libcharleyszcFace.so
: && /Users/hewanchao/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi22 --gcc-toolchain=/Users/hewanchao/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/hewanchao/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -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_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--fatal-warnings -Wl,--exclude-libs,libunwind.a -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libcharleyszcFace.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libcharleyszcFace.so CMakeFiles/charleyszcFace.dir/src/main/cpp/FaceAlign.cpp.o CMakeFiles/charleyszcFace.dir/src/main/cpp/FaceEngine_jni.cpp.o CMakeFiles/charleyszcFace.dir/src/main/cpp/FaceNet.cpp.o CMakeFiles/charleyszcFace.dir/src/main/cpp/Liveness.cpp.o CMakeFiles/charleyszcFace.dir/src/main/cpp/detecte.cpp.o ../../../../src/main/jniLibs/armeabi-v7a/libncnn.a ../../../../src/main/jniLibs/armeabi-v7a/libopencv_java3.so -ljnigraphics -lz -llog -latomic -lm && :
../../../../src/main/cpp/detecte.cpp:278: error: undefined reference to 'ncnn::resize_bilinear(ncnn::Mat const&, ncnn::Mat&, int, int, ncnn::Allocator*, int)'
../../../../src/main/cpp/detecte.cpp:314: error: undefined reference to 'ncnn::resize_bilinear(ncnn::Mat const&, ncnn::Mat&, int, int, ncnn::Allocator*, int)'
../../../../src/main/cpp/detecte.cpp:334: error: undefined reference to 'ncnn::copy_cut_border(ncnn::Mat const&, ncnn::Mat&, int, int, int, int, ncnn::Allocator*, int)'
../../../../src/main/cpp/detecte.cpp:336: error: undefined reference to 'ncnn::resize_bilinear(ncnn::Mat const&, ncnn::Mat&, int, int, ncnn::Allocator*, int)'
../../../../src/main/cpp/detecte.cpp:358: error: undefined reference to 'ncnn::copy_cut_border(ncnn::Mat const&, ncnn::Mat&, int, int, int, int, ncnn::Allocator*, int)'
../../../../src/main/cpp/detecte.cpp:360: error: undefined reference to 'ncnn::resize_bilinear(ncnn::Mat const&, ncnn::Mat&, int, int, ncnn::Allocator*, int)'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):net.cpp:function ncnn::Net::load_param(AAssetManager*, char const*): error: undefined reference to 'AAssetManager_open'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):net.cpp:function ncnn::Net::load_param(AAssetManager*, char const*): error: undefined reference to 'AAsset_close'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):net.cpp:function ncnn::Net::load_param_bin(AAssetManager*, char const*): error: undefined reference to 'AAssetManager_open'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):net.cpp:function ncnn::Net::load_param_bin(AAssetManager*, char const*): error: undefined reference to 'AAsset_close'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):net.cpp:function ncnn::Net::load_model(AAssetManager*, char const*): error: undefined reference to 'AAssetManager_open'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(net.cpp.o):net.cpp:function ncnn::Net::load_model(AAssetManager*, char const*): error: undefined reference to 'AAsset_close'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(datareader.cpp.o):datareader.cpp:function ncnn::DataReaderFromAndroidAsset::scan(char const*, void*) const: error: undefined reference to 'AAsset_seek'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(datareader.cpp.o):datareader.cpp:function ncnn::DataReaderFromAndroidAsset::scan(char const*, void*) const: error: undefined reference to 'AAsset_getBuffer'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(datareader.cpp.o):datareader.cpp:function ncnn::DataReaderFromAndroidAsset::scan(char const*, void*) const: error: undefined reference to 'AAsset_seek'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(datareader.cpp.o):datareader.cpp:function ncnn::DataReaderFromAndroidAsset::read(void*, unsigned int) const: error: undefined reference to 'AAsset_read'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
NDK用的是21.0.6113669
@h3clikejava NDK可以尝试用16b的版本,我在这个项目用的是16b的
NDK用的是21.0.6113669
我ncnn的so是在公司电脑编译的,但是安卓项目是在我自己的电脑上开发的,所以应该不会有路径问题
@h3clikejava 哥们你解决这个问题了吗? 我也是这个问题 不知道为啥
@YuGongCharley 请问下博主是不是漏放了一个arm64-v8a的libnewlohooFace.so文件呢?
提示 /home/newlohoo/Desktop/ncnn-master/src/blob.h:24: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string const&)'
这个路径在哪里定义的?全局搜不到newlohoo