c++ - Qt dll error with opencv -


i'm trying run program display image using opencv following errors:

file not recognized: file format not recognized c:\opencv\release\bin\opencv_ffmpeg249_64.dll  error:id returned 1 exit status file not found: collect2.exe 

.pro file:

qt       += core  qt       -= gui  target = myfirstopencvproject config   += console config   -= app_bundle config   -= qt  template = app   sources += main.cpp  includepath += c://opencv//release//install//include  libs += c://opencv//release//bin//*.dll  #libs += c://opencv//release//lib//*.a  libs += -lc://opencv//release//lib -llibopencv_core249 -llibopencv_highgui249 -llibopencv_imgproc249  other_files += \     img.jpg 

main.cpp

#include <opencv2/opencv.hpp> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp>   int main() {         // read image         cv::mat image= cv::imread("img.jpg");         // create image window named "my image"         cv::namedwindow("my image");         // show image on window         cv::imshow("my image", image);         // wait key 5000 ms         cv::waitkey(1000);         return 1; } 

the image(img.jpg) in appropriate directory; project executable is. tried removing dll , code ran without errors did nothing , showed shell prompting me hit return.

enter image description here

this line problem

libs += c://opencv//release//bin//*.dll 

this line makes include .dll files in bin folder opencv. don't want this.


you may able remove line , work unable test. failing see below


what want include dll files code using. matching dlls for

  • core
  • highgui
  • imgproc

something work opencv 2.4.9 debug (remove last d release libs):

libs += c://opencv//release//bin//opencv_highgui249d.dll libs += c://opencv//release//bin//opencv_imgproc249d.dll libs += c://opencv//release//bin//opencv_core249d.dll 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -