la configuration d'OpenCV 2.4.2 avec Qt Creator

J'ai essayé deux méthodes pour utiliser opencv avec qt creator
premier à utiliser Mingw où les dll et .dll.un fichiers déjà téléchargés avec la bibliothèque opencv et je viens d'ajouter une référence à l' .dll.un fichiers dans le .pro fichier comme suit

INCLUDEPATH += D:\\OpenCV\\opencv\\build\\include
LIBS += D:\\OpenCV\\opencv\\build\\x64\\mingw\\lib\\libopencv_calib3d242.dll.a
LIBS += D:\\OpenCV\\opencv\\build\\x64\\mingw\\lib\\libopencv_contrib242.dll.a
LIBS += D:\\OpenCV\\opencv\\build\\x64\\mingw\\lib\\libopencv_core242.dll.a
LIBS += D:\\OpenCV\\opencv\\build\\x64\\mingw\\lib\\libopencv_features2d242.dll.a

J'ai un code simple pour tester opencv:

#include <QtCore/QCoreApplication>
#include <opencv/cv.h>

using namespace cv;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    Mat image;

    return a.exec();
}

mais j'ai eu une accumulation de questions que de suivre

C:\Users\Kato\Documents\QT les projets\QtOpenCVYaRab\debug\main.o:-1: En fonction ~Mat':
d:\OpenCV\opencv\build\include\opencv2\core\mat.hpp:278: error: undefined reference to
cv::fastFree(void*)'
d:\OpenCV\opencv\build\include\opencv2\core\mat.php:367: erreur: undefined reference to `cv::Mat::deallocate()'
:-1: erreur: collect2: ld a retourné 1 code de sortie

Ici une partie de la compilation de sortie:

Running build steps for project QtOpenCVYaRab...
Configuration unchanged, skipping qmake step.
Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe" 
C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/Kato/Documents/QT projects/QtOpenCVYaRab'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL

 d:/OpenCV/opencv/build/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
debug/main.o:d:/OpenCV/opencv/build/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\QtOpenCVYaRab.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project QtOpenCVYaRab (target: Desktop)
When executing build step 'Make'

la deuxième méthode est l'utilisation de cmake pour compiler la bibliothèque opencv l'aide de visual studio 2010 pour créer et ajouter des références aux fichiers dans le dossier bin, mais j'ai eu presque le même bâtiment.

Jetez un oeil à (OpenCV avec d'autres GUI)[stackoverflow.com/questions/2210937/...

OriginalL'auteur Ahmed Kato | 2012-08-25