目录
:-1: error: init_box_selector.o: undefined reference to symbol '_ZN2cv9rectangleERKNS_17_InputOutputArrayENS_6Point_IiEES4_RKNS_7Scalar_IdEEiii'
/usr/local/lib/libopencv_imgproc.so.3.0:-1: error: error adding symbols: DSO missing from command line
error adding symbols: DSO missing from command line
编译错误问题解决办法:直接指定包含库的路径和库的名称
pro文件添加:
LIBS += `pkg-config opencv --cflags --libs`
LIBS += /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_core.so
原因2 没有创建软链接
客户给的opencv库是带版本号的:
解决方法 创建软链接
ln -sf libopencv_imgproc.so.3.4.16 libopencv_imgproc.so.3.4
ln -sf libopencv_imgproc.so.3.4 libopencv_imgproc.so
ln -sf libopencv_video.so.3.4.16 libopencv_video.so.3.4
ln -sf libopencv_video.so.3.4 libopencv_video.so
ls -l libopencv_imgproc.so
ln -sf libopencv_imgcodecs.so.3.4.16 libopencv_imgcodecs.so.3.4
ln -sf libopencv_imgcodecs.so.3.4 libopencv_imgcodecs.so
ls -l libopencv_imgcodecs.so
然后就可以引用opencv库了
INCLUDEPATH +=/home/lbg/soft/opencv-3.4.6/include
LIBS += -L/home/kylin/sdk_demo/lib/ -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -lfaceliveness -lfacesdk -lMNN