0

I am not a C++ master (far from that actually), I try to setup an OpenCV + Qt project. I have downloaded the last release of OpenCV. I did nothing more with that (if I understand well, everything is pre-built, so I just have to add the path to the libs in my .pro file).

I added the path to the include folder /opencv/include

That should work that way, since the includes in cv.h, for example, are like that :

include "opencv2/core/core_c.h"

However, when I browse through my opencv folder, opencv2 is empty, there is no core folder in it, nor anything else, actually there is just a header file, opencv.h .

I noticed that all my include are spread into several folders, under the module folder... what should I do??

Thank you very much!

4

3 回答 3

1

您必须以.pro文件module方式添加这些库,这意味着您必须将项目中使用的所有模块添加到文件中的LIBS变量中.pro。假设您正在使用模块 libopencv1、libopencv2、libopencv3

LIBS += -L/usr/lib -lopencv1 -lopencv2 -lopencv3

像那样。

如果将 opencv 库添加到,请/usr/local/lib使用-L/usr/local/lib instead-L/usr/lib

于 2012-05-30T14:45:43.157 回答
0

好的,我找到了答案...

正确的包含文件夹是构建文件夹中的一个... -_-'

于 2012-05-30T15:08:36.833 回答
0

这是我的 .pro 文件:

QT       += core gui

TARGET = test_MTI880
TEMPLATE = app

SOURCES += ... ... ...

INCLUDEPATH += D:/PointGreyResearch/FlyCapture2/include \
        += D:/opencv/include

LIBS += D:/opencv/build/x86/vc10/lib/opencv_core240.lib \
        D:/opencv/build/x86/vc10/lib/opencv_highgui240.lib \
        D:/opencv/build/x86/vc10/lib/opencv_imgproc240.lib \
        D:/opencv/build/x86/vc10/lib/opencv_objdetect240.lib \
        D:/PointGreyResearch/FlyCapture2/lib/FlyCapture2.lib \
        D:/PointGreyResearch/FlyCapture2/lib/C/FlyCapture2_C.lib \
        D:/PointGreyResearch/FlyCapture2/lib/FlyCapture2d.lib \
        D:/PointGreyResearch/FlyCapture2/lib/FC1/PGRFlyCapture.lib
于 2012-05-30T14:51:35.003 回答