QT添加动态库

1、添加动态库
.pro文件添加如下信息(-l后面是动态库)

#-L add library directory
#-l add link library
LIBS += -L/usr/local/opencv-3.4/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_video -lopencv_videoio -lopencv_imgcodecs
LIBS += -L/usr/local/cuda-9.0/lib -lcudart -Wl,-rpath=.

2、解决动态库直接运行可执行程序保存找不到链接库

LIBS +=-Wl,-rpath=.

你可能感兴趣的:(C++)