[英]OpenCV3.0 With Qt creator 3.2 & Qt 5.4 build error “mingw32-make: *** [Makefile] Error 3”
I have compiled OpenCV 3.0 with Qt5.4 & Qt Creator 3.2 64 bits in a Windows 7 machine. 我在Windows 7机器上用Qt5.4和Qt Creator 3.2 64位编译了OpenCV 3.0。
I have been trying to execute the most basic OpenCV functionalaty in loading a picture. 我一直在尝试在加载图片时执行最基本的OpenCV功能。 Unfortunately it gives the following error:
不幸的是,它给出了以下错误:
C:\\Qt\\qt-5.4.0-x64-mingw492r0-sjlj\\qt-5.4.0-x64-mingw492r0-sjlj\\bin\\qmake.exe -spec win32-g++ CONFIG+=release -o Makefile ..\\opencv_xpto\\opencv_xpto.pro C:/Users/Nelson Faria/Documents/Programacao/opencv_xpto/opencv_xpto.pro:14: Extra characters after test expression.
C:\\ Qt \\ qt-5.4.0-x64-mingw492r0-sjlj \\ qt-5.4.0-x64-mingw492r0-sjlj \\ bin \\ qmake.exe -spec win32-g ++ CONFIG + = release -o Makefile .. \\ opencv_xpto \\ opencv_xpto.pro C:/ Users / Nelson Faria / Documents / Programacao / opencv_xpto / opencv_xpto.pro:14:测试表达后的额外字符。 Error processing project file: ..\\opencv_xpto\\opencv_xpto.pro makefile:175: recipe for target 'Makefile' failed mingw32-make: *** [Makefile] Error 3 20:53:17: The process "C:\\Qt\\qt-5.4.0-x64-mingw492r0-sjlj\\mingw64\\bin\\mingw32-make.exe" exited with code 2. Error while building/deploying project opencv_xpto (kit: Qt 5.4) When executing step "Make" 20:53:17: Elapsed time: 00:01.
处理项目文件时出错:.. \\ opencv_xpto \\ opencv_xpto.pro makefile:175:目标'Makefile'的配方失败mingw32-make:*** [Makefile]错误3 20:53:17:进程“C:\\ Qt \\ qt-5.4.0-x64-mingw492r0-sjlj \\ mingw64 \\ bin \\ mingw32-make.exe“退出代码2.构建/部署项目时出错opencv_xpto(kit:Qt 5.4)执行步骤”Make“时20:53: 17:经过的时间:00:01。
The code I'm trying to execute is the following: 我正在尝试执行的代码如下:
'#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv/cv.h"
using namespace std;
int main()
{
cout << "Hello World!" << endl;
cv::Mat mat;
mat = cv::imread("img.JPG");
cv::namedWindow("hello");
cv::imshow("hello",mat);
cv::waitKey(0);
return 0;
}
And finally the .pro 最后是.pro
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
INCLUDEPATH += C:\opencv-mingw\install\include
LIBS += -LC:\\opencv-mingw\\install\\x64\mingw\\lib
-lopencv_core300.dll \
-lopencv_highgui300.dll \
-lopencv_imgproc300.dll \
-lopencv_features2d300.dll \
-lopencv_calib3d300.dll
include(deployment.pri)
qtcAddDeployment()'
Can someone inlight me where I gone wrong? 在我出错的地方有人可以告诉我吗?
Correct pro file like that: 正确的pro文件:
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
INCLUDEPATH += C:/opencv-mingw/install/include
LIBS += -LC:/opencv-mingw/install/x64/mingw/lib
-lopencv_core300 \
-lopencv_highgui300 \
-lopencv_imgproc300 \
-lopencv_features2d300 \
-lopencv_calib3d300
include(deployment.pri)
qtcAddDeployment()
<your roject location>\\..\\debug-windows-64x-qt5-XXX
<your roject location>\\..\\debug-windows-64x-qt5-XXX
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.