[SOLVED]Linking to OpenCV 2.3.1 using OpenCV-2.3.0-win-superpack.exe built dlls in Qt project on Windows
-
Hello,
Let me describe next situation and exchange experience/ask for help:I use :
IplImage *im;
CvSize cvsz;
CvVideoWriter *writer;
cvCreateVideoWriter ( ), cvReleaseVideoWriter ( ) functionsfor that I've installed ( actually unpacked ) latest OpenCV pack with prebuilt .dll for x86 for mingw :
http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/
( superpack )
I've unpacked the superpack to D:/opencv directory.
Next lines've been added to .pro file :@LIBS += D:\opencv\opencv\build\x86\mingw\bin*.dll
INCLUDEPATH += D:\opencv\opencv\include
D:\opencv\opencv\include\opencv
D:\opencv\opencv\include\opencv2@and next header includes :
@#include "D:\opencv\opencv\include\opencv\cv.h"
#include "D:\opencv\opencv\include\opencv\highgui.h"
#include "D:\opencv\opencv\include\opencv\cvaux.h"@The project is succ. built on Windows XP but when I run it from the directory with the opencv's .dlls I get next error :
Entry point not found : "The procedure entry point_ZNSt9exceptionD2Ev could not be located in the dynamic link library"
Does anybody know why such a problem ? How to fix/repair ?
As I understood from previous disccussions on the same topic :
http://www.qtcentre.org/threads/32393-OpenCV-2.1-Qt-4.6-on-WindowsXP
http://www.barbato.us/2011/03/18/using-opencv2-within-qtcreator-in-windows-2/
http://knowtheabc.wordpress.com/2011/02/25/windows-opencv-and-qt-creator/
http://forums.codeblocks.org/index.php/topic,15466.0/prev_next,prev.html#new
the problem is that opencv sources should be built using CMake for further specific compile system MinGW or MSVisual studio. But the superpack version already contains prebuilt for MinGW that can be used ,right ?
Also whether SSE / SSE2 options are needed to take into considerations ?Perhpas I'll find later the solution but nevertheless I ask also here to share and perhaps to find elegant way together.Thanks for possible clear help to workout/find out simple clear elegant solution in order to use OpenCV in Qt projects.
-
If you add some path to INCLUDEPATH, you won't have to use full path in #include.
@#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <opencv\cvaux.h>@"The procedure entry point" error usually occurs when you have wrong dll file. Did you accidentally copy VS's dll files (not MinGW's) to your executable's directory?
-
Hi
I need a help. I am trying to integrate the opencv2.3 with qt in ubuntu 11.04 but I got one error.
The following is the Application output:"Starting /home/krishanu/Hello-build-desktop/Hello...
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /home/krishanu/OpenCV-2.3.0/modules/core/src/array.cpp, line 2482
terminate called after throwing an instance of 'cv::Exception'
what(): /home/krishanu/OpenCV-2.3.0/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMatThe program has unexpectedly finished.
/home/krishanu/Hello-build-desktop/Hello exited with code 0"This is my source code:
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"int main()
{
cv::Mat imag;
imag= cv::imread("fruits.jpg");
cv::namedWindow("MyImage");
cv::imshow("Myimage",imag);
cvWaitKey(5000);
return 1;
}This is my.pro file
#-------------------------------------------------Project created by QtCreator 2012-05-14T18:08:31
#-------------------------------------------------
QT += core
QT -= gui
TARGET = Hello
CONFIG += console
CONFIG -= app_bundleTEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH +=/usr/include/opencv
LIBS+=-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
It would be of great help if someone would could help me.Thanks in advance.