XinghaoChen9 / LiveFaceReco_RaspberryPi

Face recognition and live estimation on Raspberry Pi 4B with average FPS around 20 and 2800+ faces loaded.
Other
177 stars 45 forks source link

libncnn error miss glslang? when build lib ncnn, i built glslang but still undefined reference? #11

Open damvantai opened 3 years ago

damvantai commented 3 years ago

/usr/bin/ld: /window10/Users/tai94/Documents/baolinh/cv/LiveFaceReco_RaspberryPi_2/include/lib/libncnn.a(gpu.cpp.o): in function ncnn::destroy_gpu_instance()': gpu.cpp:(.text+0xdad): undefined reference toglslang::FinalizeProcess()' /usr/bin/ld: /window10/Users/tai94/Documents/baolinh/cv/LiveFaceReco_RaspberryPi_2/include/lib/libncnn.a(gpu.cpp.o): in function ncnn::create_gpu_instance()': gpu.cpp:(.text+0x44e9): undefined reference toglslang::InitializeProcess()' /usr/bin/ld: /window10/Users/tai94/Documents/baolinh/cv/LiveFaceReco_RaspberryPi_2/include/lib/libncnn.a(gpu.cpp.o): in function ncnn::compile_spirv_module(char const*, int, ncnn::Option const&, std::vector<unsigned int, std::allocator<unsigned int> >&)': gpu.cpp:(.text+0x88b8): undefined reference toglslang::TShader::TShader(EShLanguage)' /usr/bin/ld: gpu.cpp:(.text+0x88d3): undefined reference to glslang::TShader::setStringsWithLengths(char const* const*, int const*, int)' /usr/bin/ld: gpu.cpp:(.text+0x88f0): undefined reference toglslang::TShader::addProcesses(std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > > const&)' /usr/bin/ld: gpu.cpp:(.text+0x88ff): undefined reference to glslang::TShader::setEntryPoint(char const*)' /usr/bin/ld: gpu.cpp:(.text+0x890e): undefined reference toglslang::TShader::setSourceEntryPoint(char const)' /usr/bin/ld: gpu.cpp:(.text+0x8adf): undefined reference to `glslang::TShader::parse(TBuiltInResource const, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&)' /usr/bin/ld: gpu.cpp:(.text+0x8b1e): undefined reference to glslang::TShader::getInfoLog()' /usr/bin/ld: gpu.cpp:(.text+0x8b3e): undefined reference toglslang::TShader::getInfoDebugLog()' /usr/bin/ld: gpu.cpp:(.text+0x8b64): undefined reference to glslang::TShader::~TShader()' /usr/bin/ld: gpu.cpp:(.text+0x8c39): undefined reference toglslang::GlslangToSpv(glslang::TIntermediate const&, std::vector<unsigned int, std::allocator >&, glslang::SpvOptions)' /usr/bin/ld: gpu.cpp:(.text+0x8c44): undefined reference to glslang::TShader::~TShader()' /usr/bin/ld: /window10/Users/tai94/Documents/baolinh/cv/LiveFaceReco_RaspberryPi_2/include/lib/libncnn.a(gpu.cpp.o): in functionncnn::compile_spirv_module(char const, int, ncnn::Option const&, std::vector<unsigned int, std::allocator >&) [clone .cold]': gpu.cpp:(.text.unlikely+0x204): undefined reference to `glslang::TShader::~TShader()' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/LiveFaceReco.dir/build.make:152: LiveFaceReco] Error 1 make[1]: [CMakeFiles/Makefile2:85: CMakeFiles/LiveFaceReco.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

y9luiz commented 3 years ago

You must compile your ncnn with glslang support cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_VULKAN=ON -DNCNN_SYSTEM_GLSLANG=ON -DNCNN_BUILD_EXAMPLES=ON .. doesn't forget to clone the libncnn repository with --recursive option

git clone https://github.com/Tencent/ncnn.git --recursive
thinhemb commented 2 years ago

you can setup your ncnn android by cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON -DNCNN_ENABLE_LTO=OFF ..