ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

error: undefined reference to `ConstructCompiler(EShLanguage, int)'

Open chingi071 opened this issue 3 years ago • 7 comments

detail | 详细描述 | 詳細な説明

Hello, I installed ncnn on jetson nano and compiled the NCNN example on QT, but the following problems occurred. Excuse me, is there a file that I missed that caused this problem? Image 1

I follow the steps below to compile ncnn on jetson nano.

$ git submodule update --depth=1 --init $ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/jetson.toolchain.cmake \ -DNCNN_BUILD_EXAMPLES=ON \ -DNCNN_BUILD_TOOLS=ON \ -DNCNN_VULKAN=ON \ -DNCNN_SYSTEM_GLSLANG=ON \ -DCMAKE_BUILD_TYPE=Release \ -DNCNN_DISABLE_RTTI=OFF .. $ make -j4 $ sudo make install

My QT compilation settings are as follows.

SOURCES += test.cpp

INCLUDEPATH += /home/user/ncnn/build/install/include/ncnn
/home/user/ncnn/build/install/include/glslang
/home/user/ncnn/build/install/include/glslang/Include
/home/user/ncnn/build/install/include/glslang/MachineIndependent
/home/user/ncnn/build/install/include/glslang/MachineIndependent/preprocessor
/home/user/ncnn/build/install/include/glslang/Public
/home/user/ncnn/build/install/include/glslang/SPIRV
/usr/include/opencv4
/usr/include/opencv4/opencv2

LIBS += /home/user/ncnn/build/install/lib/libncnn.a
/home/user/ncnn/build/install/lib/libglslang.a
/home/user/ncnn/build/install/lib/libGenericCodeGen.a
/home/user/ncnn/build/install/lib/libMachineIndependent.a
/home/user/ncnn/build/install/lib/libOGLCompiler.a
/home/user/ncnn/build/install/lib/libOSDependent.a
/home/user/ncnn/build/install/lib/libSPIRV.a
/usr/lib/aarch64-linux-gnu/libopencv_*.so.4.1
/usr/lib/aarch64-linux-gnu/libvulkan.so.1.2

QMAKE_CXXFLAGS += -fopenmp QMAKE_LFLAGS += -fopenmp LIBS += -fopenmp

chingi071 avatar Sep 23 '21 07:09 chingi071

Hello,Did you solve the problem?I meet the same problem.

cyinen avatar Jan 20 '22 13:01 cyinen

-lglslang -lshaderc_shared

Z-Xiong avatar Mar 17 '22 06:03 Z-Xiong

Building as a shared lib solved similar problem. Check in CmakeList.txt: #option(NCNN_SHARED_LIB "shared library support" OFF) change to option(NCNN_SHARED_LIB "shared library support" ON)

abaghiyan avatar Mar 20 '22 10:03 abaghiyan

Building as a shared lib solved similar problem. Check in CmakeList.txt: #option(NCNN_SHARED_LIB "shared library support" OFF) change to option(NCNN_SHARED_LIB "shared library support" ON)

I try this but it seems not working

EricTonyLiu avatar Apr 14 '22 14:04 EricTonyLiu

Building as a shared lib solved similar problem. Check in CmakeList.txt: #option(NCNN_SHARED_LIB "shared library support" OFF) change to option(NCNN_SHARED_LIB "shared library support" ON)

This type of build may affect some detectors leading to incorrect results. For instance, on yolov4 example I got negative detection rect coordinates (from output ncnn::Mat of extractor) and many false positives. So this solves linking issues but also leads to risks and inaccuracies for several detectors.

abaghiyan avatar Apr 27 '22 20:04 abaghiyan

我在cgo链接时也遇到了类似的问题,我通过调整链接库的顺序,通过了编译 image 也许你可以按这个顺序试试

jinzhongmin avatar Jun 08 '22 08:06 jinzhongmin

我在cgo链接时也遇到了类似的问题,我通过调整链接库的顺序,通过了编译 image 也许你可以按这个顺序试试

that works!

zxpzhong avatar Jun 29 '22 09:06 zxpzhong