Qt Creator’s MSVC2010 debug compiler didn’t work with OpenCV in Windows system
But MSVC2010 release compiler works well with OpenCV.I don’t know why.
Here’s part of my .pro file.
- INCLUDEPATH +=D:\OpenCV\opencv\build\include\opencv2 \
- D:\OpenCV\opencv\build\include\opencv \
- D:\OpenCV\opencv\build\include
- CONFIG(release,debug|release)
- {
- LIBS += D:\OpenCV\opencv\build\x86\vc10\lib\opencv_calib3d231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_contrib231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_core231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_features2d231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_flann231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_gpu231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_highgui231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_imgproc231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_legacy231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_ml231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_objdetect231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_ts231.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_video231.lib
- }
- CONFIG(debug,debug|release)
- {
- LIBS +=D:\OpenCV\opencv\build\x86\vc10\lib\opencv_calib3d231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_contrib231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_core231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_features2d231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_flann231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_gpu231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_highgui231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_imgproc231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_legacy231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_ml231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_objdetect231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_ts231d.lib \
- D:\OpenCV\opencv\build\x86\vc10\lib\opencv_video231d.lib
- }
Thank you for your attention.
10 replies
Here’s my code which is used to load and show a image.
- #include <QtCore/QCoreApplication>
- #include <opencv.hpp>
- using namespace std;
- using namespace cv;
- int main(int argc, char *argv[])
- {
- const char* imagename = "E:\\library\\Pictures\\images\\boldt.jpg";
- //load image
- Mat img = imread(imagename);
- //if loading image failed
- if(img.empty())
- {
- cout<<"Can't load image"<<imagename;
- waitKey();
- return -1;
- }
- //show image
- imshow("image", img);
- //wait
- waitKey();
- return a.exec();
- }
When I built my code with MSVC2010 debug compiler,the console outputted “ Can’t load image E:\library\Pictures\images\boldt.jpg”.
But if I built code with MSVC2010 release compiler,the image would show correctly.
Sounds like the jpeg plugin to Qt is missing from the debug version.
Check under $(PLACE_WHERE_QT_LIBS_ARE)/plugins/imageformats for *qjpegd.dll (not 100% sure about the name, I am on Linux). If it is missing that then your debug Qt installation is incomplete. Please build it again making sure jpeg support is enabled during “configure” or report a bug against the package (if you downloaded the binary from somewhere).
Sorry, I am not sure I understand your problem then.
Did you check whether running your application in debug build is finding the image plugins or did you compare file access during compilation? What do you mean with “debugging compiler”? What does Qt not being able to load images have to do with opencv?
That’s all right.
In Windows,Qt Creator has 4 compiling choices : MSVC2010 debugging compiler,MSVC2010 release compiler,MinGW4.4 debugging compiler and MinGW4.4 release compiler.
I didn’t find image plugin but I have compared file access more or less.
imread and imshow functions are from OpenCV.If loading image failed,it turned out that OpenCV didn’t work.
You must log in to post a reply. Not a member yet? Register here!


