0

我已经按照本教程安装了 qt 5.0.2 和 opencv 2.4.5 和 windows 7 32 位,但是当我完成后,我使用上一个链接中提到的示例对其进行了测试,但我遇到了这个错误

error: opencv2/core/core.hpp: No such file or directory 

更新


前 5 个错误:

C:\opencv\opencv_bin\install\include\opencv2\core\core.hpp:4341: In file included from ..\..\..\..\..\..\opencv\opencv_bin\install\include/opencv2/core/core.hpp:4341:0,
C:\Qt\Qt5.0.2\Tools\QtCreator\bin\test2\main.cpp:2: from ..\test2\main.cpp:2:
C:\opencv\opencv_bin\install\include\opencv2\core\operations.hpp:928: error: prototype for 'cv::Vec<_Tp, n> cv::Matx<_Tp, m, n>::solve(const cv::Vec<_Tp, m>&, int) const' does not match any in class 'cv::Matx<_Tp, m, n>'
C:\Qt\Qt5.0.2\Tools\QtCreator\bin\test2\main.cpp:2: In file included from ..\test2\main.cpp:2:0:
C:\opencv\opencv_bin\install\include\opencv2\core\core.hpp:495: error: candidates are: cv::Matx<_Tp, n, 1> cv::Matx<_Tp, m, n>::solve(const cv::Matx<_Tp, m, 1>&, int) const

任何人都可以帮助我确定是什么问题以及如何解决它。

4

2 回答 2

2

在教程中,这个人实际上告诉你如何做到这一点。提炼:

QT       += core
QT       -= gui
TARGET = myFirstOpenCVProject
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:\\OpenCV-2.3.1\\install\\include # <--- this
LIBS += -LC:\\OpenCV-2.3.1\\install\\lib \
    -lopencv_core231.dll \
    -lopencv_highgui231.dll \
    -lopencv_imgproc231.dll \
    -lopencv_features2d231.dll \
    -lopencv_calib3d231.dll
于 2013-05-15T23:34:09.467 回答
0

问题已解决...这是 q creator 和 opencv 之间的兼容性问题,我已经按照相同的教程安装了QTsdKopencv 2.3.1cmake 2.8.11 , 并且每个想法都以正确的方式进行:)

于 2013-05-17T09:29:53.223 回答