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.
LIBS += D:\OpenCV\opencv\build\x86\vc10\lib\opencv_calib3d231.lib
Thank you for your attention.
What does not work? Building your code (compiling/linking) or debugging it afterwards? Are there error messages or popups or something? What are you actually trying to do?
Here's my code which is used to load and show a image.
using namespace std;
using namespace cv;
int main(int argc, char argv)
QCoreApplication a(argc, argv);
const char imagename = "E:\library\Pictures\images\boldt.jpg";
Mat img = imread(imagename);
//if loading image failed
cout<<"Can't load image"<<imagename;
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).
I have qjpeg4.dll and qjpegd4.dll.And even if I change the format of the image such as .bmp,the situation is same.
Then please try to find out why the debug version does not pick up the plugins. There are tools to monitor which files a application tries to access, that might help here.
I used Process Monitor to have a look,and there is almost no difference between debugging compiling and release compiling.Then I re-installed Qt Creator,the debugging compiler still didn't work with OpenCV.
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.
In addition,when I used visual studio 2010's debugging mode to compile the code which had used OpenCV,it worked well.So I think there's nothing wrong with OpenCV.
nimcap last edited by
I am having almost the same problem, any updates on the issue? I started believing this is a bug in OpenCV that has something to do with Qt.