我正在处理以下代码:
主文件
#include <QCoreApplication>
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(int argc, char *argv[])
{
Mat image = imread("C:/Users/Public/Pictures/Sample Pictures/Tulips.jpg");
namedWindow("Image");
imshow("Image",image);
waitKey(0);
}
测试.pro
#-------------------------------------------------
#
# Project created by QtCreator 2013-05-07T10:38:38
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = Test
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += E:/Jasmin/Yohan/opencv/build/include
INCLUDEPATH += E:/Jasmin/Yohan/opencv/include/opencv2
LIBS += E:/Jasmin/Yohan/opencv/build/x86/mingw/lib/libopencv_calib3d240.dll.a
LIBS += E:/Jasmin/Yohan/opencv/build/x86/mingw/lib/libopencv_contrib240.dll.a
LIBS += E:/Jasmin/Yohan/opencv/build/x86/mingw/lib/libopencv_core240.dll.a
LIBS += E:/Jasmin/Yohan/opencv/build/x86/mingw/lib/libopencv_highgui240.dll.a
LIBS += E:/Jasmin/Yohan/opencv/build/x86/mingw/lib/libopencv_imgproc240.dll.a
当我运行此代码时,没有显示图像,打印以下输出
Starting E:\Jasmin\Yohan\QTProjects\build-Test-Desktop_Qt_5_0_2_MinGW_32bit-Debug\debug\Test...
E:\Jasmin\Yohan\QTProjects\build-Test-Desktop_Qt_5_0_2_MinGW_32bit-Debug\debug\Test exited with code 0
以下opencv相关的环境变量被添加到“path”系统变量中
E:\Jasmin\Yohan\opencv\build\x86\mingw\bin;E:\Jasmin\Yohan\opencv\build\x86\vc10\bin
为什么我会遇到这个问题?我的 QT creator 版本是 2.7.0
更新
这就是我的调试器必须说的: