PDA

View Full Version : Qt 4.8.3 - QtCreator 2.6.0 - MinGW 4.4 and OpenCV 2.4.3



giorgik
17th November 2012, 12:11
Hello all. I have Qt 4.8.3, QtCreator 2.6.0, MinGW 4.4 (then OS Windows XP) and I want to use OpenCV 2.4.3
Can you help me to set up the project file .pro ?
Below I report a sample project that should see two figures jpg:


QT += core
QT -= gui
TARGET = testOpenCV_1
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
INCLUDEPATH += C:\opencv\modules\core\include\ \
C:\opencv\modules\highgui\include\
LIBS += C:\opencv\build\x86\mingw\lib\libopencv_core243.dl l.a \
C:\opencv\build\x86\mingw\lib\libopencv_highgui243 .dll.a
SOURCES += main.cpp

the main.cpp:


#include <QCoreApplication>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

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

// strutture dati per le immagini caricate
cv::Mat immagine1;
cv::Mat immagine2;

// caricamento immagine
immagine1 = cv::imread("Viale.jpg");
immagine2 = cv::imread("Tropici.jpg");

// verifica del corretto caricamento
if(immagine1.empty() || immagine2.empty())
{
return -1;
}

// visualizzazione immagini
cv::imshow("Immagine Caricata 1", immagine1);
cv::imshow("Immagine Caricata 2", immagine2);

// attesa della pressione di un tasto prima di uscire
cv::waitKey();

return a.exec();
}

only compiles without problems, but when I start my program I get the following message:
"Can not find the entry point _ZNSt9exceptionD2Ev the procedure in the dynamic link library libstdc++-6.dll"

giorgik
21st November 2012, 18:35
The problem is the version of MinGW 4.4 which creates this kind of message when you try to use OpenCV.
To remedy the problem, simply download the latest stable version (4.6.1) by choosing the first option that comes forward in the discharge of MinGW (packaged form). Recompiling the project which I quoted in the previous post, everything is ok and the program finally works.