cmdbug / YOLOv5_NCNN

🍅 Deploy ncnn on mobile phones. Support Android and iOS. 移动端ncnn部署,支持Android与iOS。
GNU General Public License v3.0
1.49k stars 302 forks source link

使用最新版本的ncnn,使用refresh linked c++ projects后还是出现如下错误,请问怎么解决 #74

Closed lavender-ling closed 2 years ago

lavender-ling commented 2 years ago

1 warning generated. [18/19] Building CXX object CMakeFiles/yolov5.dir/ocr/ocr.cpp.o [19/19] Linking CXX shared library E:\python\andriod\YOLOv5_NCNN-master\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app\build\intermediates\cmake\debug\obj\arm64-v8a\libyolov5.so FAILED: E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/build/intermediates/cmake/debug/obj/arm64-v8a/libyolov5.so cmd.exe /C "cd . && E:\SDK\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android24 --gcc-toolchain=E:/SDK/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=E:/SDK/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fopenmp -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -static-openmp -shared -Wl,-soname,libyolov5.so -o E:\python\andriod\YOLOv5_NCNN-master\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app\build\intermediates\cmake\debug\obj\arm64-v8a\libyolov5.so CMakeFiles/yolov5.dir/DBFace.cpp.o CMakeFiles/yolov5.dir/ENet.cpp.o CMakeFiles/yolov5.dir/FaceLandmark.cpp.o CMakeFiles/yolov5.dir/LightOpenPose.cpp.o CMakeFiles/yolov5.dir/MbnFCN.cpp.o CMakeFiles/yolov5.dir/MobileNetV3Seg.cpp.o CMakeFiles/yolov5.dir/NanoDet.cpp.o CMakeFiles/yolov5.dir/SimplePose.cpp.o CMakeFiles/yolov5.dir/Yolact.cpp.o CMakeFiles/yolov5.dir/YoloV4.cpp.o CMakeFiles/yolov5.dir/YoloV5.cpp.o CMakeFiles/yolov5.dir/YoloV5CustomLayer.cpp.o CMakeFiles/yolov5.dir/jni_interface.cpp.o CMakeFiles/yolov5.dir/ocr/NCNNDBNet.cpp.o CMakeFiles/yolov5.dir/ocr/RRLib.cpp.o CMakeFiles/yolov5.dir/ocr/ZUtil.cpp.o CMakeFiles/yolov5.dir/ocr/clipper.cpp.o CMakeFiles/yolov5.dir/ocr/ocr.cpp.o -llog -lvulkan -landroid -ljnigraphics E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/opencv/arm64-v8a/libopencv_java4.so -llog -lvulkan -landroid -ljnigraphics E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libglslang.a E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libOGLCompiler.a E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libOSDependent.a -latomic -lm && cd ." E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a(gpu.cpp.o): In function ncnn::create_gpu_instance()': gpu.cpp:(.text._ZN4ncnn19create_gpu_instanceEv+0x1aa0): undefined reference toglslang::InitializeProcess()' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a(gpu.cpp.o): In function ncnn::destroy_gpu_instance()': gpu.cpp:(.text._ZN4ncnn20destroy_gpu_instanceEv+0x28): undefined reference toglslang::FinalizeProcess()' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a(gpu.cpp.o): In function ncnn::compile_spirv_module(char const*, int, ncnn::Option const&, std::__ndk1::vector<unsigned int, std::__ndk1::allocator<unsigned int> >&)': gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6__ndk16vectorIjNS5_9allocatorIjEEEE+0xcae0): undefined reference toglslang::TShader::TShader(EShLanguage)' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6ndk16vectorIjNS5_9allocatorIjEEEE+0xcaf8): undefined reference to glslang::TShader::setStringsWithLengths(char const* const*, int const*, int)' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6__ndk16vectorIjNS5_9allocatorIjEEEE+0xcb20): undefined reference toglslang::TShader::addProcesses(std::ndk1::vector<std::ndk1::basic_string<char, std::__ndk1::char_traits, std::ndk1::allocator >, std::ndk1::allocator<std::ndk1::basic_string<char, std::ndk1::char_traits, std::ndk1::allocator > > > const&)' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6ndk16vectorIjNS5_9allocatorIjEEEE+0xcb34): undefined reference to `glslang::TShader::setEntryPoint(char const*)' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6ndk16vectorIjNS5_9allocatorIjEEEE+0xcb40): undefined reference to glslang::TShader::setSourceEntryPoint(char const*)' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6__ndk16vectorIjNS5_9allocatorIjEEEE+0xccf4): undefined reference toglslang::TShader::parse(TBuiltInResource const, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&)' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6ndk16vectorIjNS5_9allocatorIjEEEE+0xcd18): undefined reference to glslang::TShader::~TShader()' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6__ndk16vectorIjNS5_9allocatorIjEEEE+0xce28): undefined reference toglslang::TShader::getInfoLog()' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6ndk16vectorIjNS5_9allocatorIjEEEE+0xce44): undefined reference to glslang::TShader::getInfoLog()' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6__ndk16vectorIjNS5_9allocatorIjEEEE+0xce6c): undefined reference toglslang::TShader::getInfoDebugLog()' gpu.cpp:(.text._ZN4ncnn20compile_spirv_moduleEPKciRKNS_6OptionERNSt6__ndk16vectorIjNS5_9allocatorIjEEEE+0xce88): undefined reference to glslang::TShader::getInfoDebugLog()' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In functionglslang::GlslangToSpv(glslang::TIntermediate const&, std::ndk1::vector<unsigned int, std::ndk1::allocator >&, spv::SpvBuildLogger, glslang::SpvOptions)': GlslangToSpv.cpp:(.text._ZN7glslang12GlslangToSpvERKNS_13TIntermediateERNSt6ndk16vectorIjNS3_9allocatorIjEEEEPN3spv14SpvBuildLoggerEPNS_10SpvOptionsE+0x5c): undefined reference to `glslang::GetThreadPoolAllocator()' GlslangToSpv.cpp:(.text._ZN7glslang12GlslangToSpvERKNS_13TIntermediateERNSt6ndk16vectorIjNS3_9allocatorIjEEEEPN3spv14SpvBuildLoggerEPNS_10SpvOptionsE+0x60): undefined reference to glslang::TPoolAllocator::push()' GlslangToSpv.cpp:(.text._ZN7glslang12GlslangToSpvERKNS_13TIntermediateERNSt6__ndk16vectorIjNS3_9allocatorIjEEEEPN3spv14SpvBuildLoggerEPNS_10SpvOptionsE+0x84): undefined reference toglslang::GetThreadPoolAllocator()' GlslangToSpv.cpp:(.text._ZN7glslang12GlslangToSpvERKNS_13TIntermediateERNSt6ndk16vectorIjNS3_9allocatorIjEEEEPN3spv14SpvBuildLoggerEPNS_10SpvOptionsE+0xac): undefined reference to `glslang::GetKhronosToolId()' GlslangToSpv.cpp:(.text._ZN7glslang12GlslangToSpvERKNS_13TIntermediateERNSt6ndk16vectorIjNS3_9allocatorIjEEEEPN3spv14SpvBuildLoggerEPNS_10SpvOptionsE+0x1c70): undefined reference to glslang::GetThreadPoolAllocator()' GlslangToSpv.cpp:(.text._ZN7glslang12GlslangToSpvERKNS_13TIntermediateERNSt6__ndk16vectorIjNS3_9allocatorIjEEEEPN3spv14SpvBuildLoggerEPNS_10SpvOptionsE+0x1c74): undefined reference toglslang::TPoolAllocator::pop()' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function `(anonymous namespace)::TGlslangToSpvTraverser::visitBinary(glslang::TVisit, glslang::TIntermBinary)': GlslangToSpv.cpp:(.text._ZN12_GLOBALN_122TGlslangToSpvTraverser11visitBinaryEN7glslang6TVisitEPNS1_13TIntermBinaryE+0x8f4): undefined reference to `glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)' GlslangToSpv.cpp:(.text._ZN12_GLOBALN_122TGlslangToSpvTraverser11visitBinaryEN7glslang6TVisitEPNS1_13TIntermBinaryE+0xd60): undefined reference to glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)' GlslangToSpv.cpp:(.text._ZN12_GLOBAL__N_122TGlslangToSpvTraverser11visitBinaryEN7glslang6TVisitEPNS1_13TIntermBinaryE+0x1e64): undefined reference toglslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function (anonymous namespace)::TGlslangToSpvTraverser::visitAggregate(glslang::TVisit, glslang::TIntermAggregate*)': GlslangToSpv.cpp:(.text._ZN12_GLOBAL__N_122TGlslangToSpvTraverser14visitAggregateEN7glslang6TVisitEPNS1_16TIntermAggregateE+0x3478): undefined reference toglslang::TIntermediate::findLinkerObjects() const' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, glslang::pool_allocator<char> >::basic_string<decltype(nullptr)>(char const*)': GlslangToSpv.cpp:(.text._ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEEN7glslang14pool_allocatorIcEEEC2IDnEEPKc[_ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEEN7glslang14pool_allocatorIcEEEC2IDnEEPKc]+0x24): undefined reference toglslang::GetThreadPoolAllocator()' GlslangToSpv.cpp:(.text._ZNSt6ndk112basic_stringIcNS_11char_traitsIcEEN7glslang14pool_allocatorIcEEEC2IDnEEPKc[_ZNSt6ndk112basic_stringIcNS_11char_traitsIcEEN7glslang14pool_allocatorIcEEEC2IDnEEPKc]+0x6c): undefined reference to glslang::TPoolAllocator::allocate(unsigned long)' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function(anonymous namespace)::TGlslangToSpvTraverser::convertGlslangToSpvType(glslang::TType const&, glslang::TLayoutPacking, glslang::TQualifier const&, bool, bool)': GlslangToSpv.cpp:(.text._ZN12_GLOBALN_122TGlslangToSpvTraverser23convertGlslangToSpvTypeERKN7glslang5TTypeENS1_14TLayoutPackingERKNS1_10TQualifierEbb+0x1010): undefined reference to `glslang::TIntermediate::computeTypeLocationSize(glslang::TType const&, EShLanguage)' GlslangToSpv.cpp:(.text._ZN12_GLOBALN_122TGlslangToSpvTraverser23convertGlslangToSpvTypeERKN7glslang5TTypeENS1_14TLayoutPackingERKNS1_10TQualifierEbb+0x10e0): undefined reference to glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)' GlslangToSpv.cpp:(.text._ZN12_GLOBAL__N_122TGlslangToSpvTraverser23convertGlslangToSpvTypeERKN7glslang5TTypeENS1_14TLayoutPackingERKNS1_10TQualifierEbb+0x1140): undefined reference toglslang::TIntermediate::improperStraddle(glslang::TType const&, int, int)' GlslangToSpv.cpp:(.text._ZN12_GLOBALN_122TGlslangToSpvTraverser23convertGlslangToSpvTypeERKN7glslang5TTypeENS1_14TLayoutPackingERKNS1_10TQualifierEbb+0x1208): undefined reference to glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)' GlslangToSpv.cpp:(.text._ZN12_GLOBAL__N_122TGlslangToSpvTraverser23convertGlslangToSpvTypeERKN7glslang5TTypeENS1_14TLayoutPackingERKNS1_10TQualifierEbb+0x23b0): undefined reference toglslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)' GlslangToSpv.cpp:(.text._ZN12_GLOBALN_122TGlslangToSpvTraverser23convertGlslangToSpvTypeERKN7glslang5TTypeENS1_14TLayoutPackingERKNS1_10TQualifierEbb+0x246c): undefined reference to glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In functionglslang::TType::TType(glslang::TType const&, int, bool)': GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC2ERKS0_ib]+0x208): undefined reference to glslang::GetThreadPoolAllocator()' GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC2ERKS0_ib]+0x210): undefined reference toglslang::TPoolAllocator::allocate(unsigned long)' GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC2ERKS0_ib]+0x258): undefined reference to glslang::GetThreadPoolAllocator()' GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC2ERKS0_ib]+0x260): undefined reference toglslang::TPoolAllocator::allocate(unsigned long)' GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC2ERKS0_ib]+0x270): undefined reference to glslang::GetThreadPoolAllocator()' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In functionglslang::TType::setFieldName(std::ndk1::basic_string<char, std::__ndk1::char_traits, glslang::pool_allocator > const&)': GlslangToSpv.cpp:(.text._ZN7glslang5TType12setFieldNameERKNSt6ndk112basic_stringIcNS1_11char_traitsIcEENS_14pool_allocatorIcEEEE[_ZN7glslang5TType12setFieldNameERKNSt6ndk112basic_stringIcNS1_11char_traitsIcEENS_14pool_allocatorIcEEEE]+0x24): undefined reference to `glslang::GetThreadPoolAllocator()' GlslangToSpv.cpp:(.text._ZN7glslang5TType12setFieldNameERKNSt6ndk112basic_stringIcNS1_11char_traitsIcEENS_14pool_allocatorIcEEEE[_ZN7glslang5TType12setFieldNameERKNSt6ndk112basic_stringIcNS1_11char_traitsIcEENS_14pool_allocatorIcEEEE]+0x2c): undefined reference to glslang::TPoolAllocator::allocate(unsigned long)' E:/python/andriod/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function_ZNSt6ndk16vectorIN7glslang10TArraySizeENS1_14pool_allocatorIS2_EEE6insertINS_11wrap_iterIPS2_EEEENS_9enable_ifIXaasr21is_forward_iteratorIT_EE5valuesr16is_constructibleIS2_NS_15iterator_traitsISB_E9referenceEEE5valueES9_E4typeENS7_IPKS2_EESBSB': GlslangToSpv.cpp:(.text._ZNSt6ndk16vectorIN7glslang10TArraySizeENS1_14pool_allocatorIS2_EEE6insertINS_11wrap_iterIPS2_EEEENS_9enable_ifIXaasr21is_forward_iteratorIT_EE5valuesr16is_constructibleIS2_NS_15iterator_traitsISB_E9referenceEEE5valueES9_E4typeENS7_IPKS2_EESBSB[_ZNSt6ndk16vectorIN7glslang10TArraySizeENS1_14pool_allocatorIS2_EEE6insertINS_11wrap_iterIPS2_EEEENS_9enable_ifIXaasr21is_forward_iteratorIT_EE5valuesr16is_constructibleIS2_NS_15iterator_traitsISB_E9referenceEEE5valueES9_E4typeENS7_IPKS2_EESBSB]+0x144): undefined reference to `glslang::TPoolAllocator::allocate(unsigned long)' clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

cmdbug commented 2 years ago

使用的是vulkan版本的ncnn嘛,替换的目录对嘛?

lavender-ling commented 2 years ago

使用的是vulkan版本的ncnn嘛,替换的目录对嘛?

是vulkan版本的,将原工程相应的文件替换为最新的了

cmdbug commented 2 years ago

使用默认的工程不进行替换先跑起来,再尝试替换最新的版本。

lavender-ling commented 2 years ago

原先的工程可以跑,量化之前的模型也运行正常,想试试int8模型,出现app闪退,发现是量化工具版本和nccn库版本不一致,所以想采用最新ncnn。出错与图片相同。 123899877-9e5cb980-d99a-11eb-92b4-2a960bda1fc1

lavender-ling commented 2 years ago

解决了,需要更改cmake中的ncnn库配置信息。