Important: Please read the Qt Code of Conduct -

[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 ( ) functions

    for that I've installed ( actually unpacked ) latest OpenCV pack with prebuilt .dll for x86 for mingw :

    ( 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

    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 :,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.
    Thanks Latexi95 - you are right concerns includes and dll'.
    Now I've solved the problem by generating the opencv needed dll's by building for my platform using cmake + mingw and running with that built by cmake + mingw dlls.

  • 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 cvGetMat

    The 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");
    return 1;

    This is file

    Project created by QtCreator 2012-05-14T18:08:31


    QT += core

    QT -= gui

    TARGET = Hello
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = 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.

Log in to reply