系统相关
首页 > 系统相关> > ubuntu QT pro文件添加库

ubuntu QT pro文件添加库

作者:互联网

1、打开qt->创建工程->Non-Qi Project->Plain C++ Applicaton->完成

2、在.pro文件中加入如下

INCLUDEPATH += /usr/local/include/opencv/
/usr/local/include/opencv2/
/usr/local/include

LIBS += -lopencv_core\
-lopencv_imgproc\
-lopencv_highgui\
-lopencv_ml\
-lopencv_video\
-lopencv_features2d\
-lopencv_calib3d\
-lopencv_objdetect\
-lopencv_contrib\
-lopencv_legacy\
-lopencv_flann

3、.cpp中代码如下

#include<opencv2/opencv.hpp>

using namespace cv;

int main()
{
    Mat I=imread("/home/jv/桌面/lena.png");  //桌面上放lena.png图片
    namedWindow("1");
    imshow("1",I);
    waitKey(0);

    return 0;
}

标签:lena,lopencv,QT,pro,usr,ubuntu,include,local
来源: https://blog.csdn.net/z952957407/article/details/100860550