I'm trying to run a program to display an image using opencv but I get the 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 an image
cv::Mat image= cv::imread("img.jpg");
// create image window named "My Image"
cv::namedWindow("My Image");
// show the image on window
cv::imshow("My Image", image);
// wait key for 5000 ms
cv::waitKey(1000);
return 1;
}
The image(img.jpg) is in the appropriate directory; where the project executable is. I tried removing the dll and the code ran without errors but it did nothing and just showed a shell prompting me to hit return.

/or double-backslashes if in windows)? Theimreaddidnt work (wrong path, corrupt file or imread is broken), so the mat you want to display is empty.cv::waitKey(0);(waits until you press a key) andreturn 0;(return 1 means error)imread("img.JPG")according to your proj file