Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
LNK1107: invalid or corrupt file: cannot read at ERROR
i did video processing with opencv by using visual studio. i want to make a interface. a friend suggested to me Qt to make a interface.
i watched a tutorial on youtube (http://www.youtube.com/watch?v=csxkdGQQgNg) but when i run it it gives me that error
please help me
and sorry my english.im still learning it.. :D
codes and error
Hi and welcome to devnet,
You don't link to dll's but to the corresponding lib files on Windows.
how can i fix it ?
Change all the LIBS lines from these:
LIBS += C:\Users\hamit\Desktop\opencv\release\bin\libopencv_core2410.dll
LIBS += -LC:/Users/hamit/Desktop/opencv/release/lib -lopencv_core2410
Notice "lib" instead of "bin", the -L without space before the path and -l(lowercase L) before the library name and no "lib" prefix or extension. Also \ is an escape character so either use / (recommended) or \.
After that place the .dll files in the directory where your app executable is and also don't forget to run Build->run qmake.
INCLUDEPATH += C:\Users\hamit\Desktop\opencv\release\install\include
LIBS += -LC:\Users\hamit\Desktop\opencv\release\lib -lopencv_core2410
LIBS += -LC:\Users\hamit\Desktop\opencv\release\lib -lopencv_contrib2410
LIBS += -LC:\Users\hamit\Desktop\opencv\release\lib -lopencv_highgui2410
LIBS += -LC:\Users\hamit\Desktop\opencv\release\lib -lopencv_imgproc2410
LIBS += -LC:\Users\hamit\Desktop\opencv\release\lib -lopencv_calib3d2410
i did like that but it gave me error again.. just error name changed.. its LNK1181: cannot open input file'..... '
The '...' is very important :) It tells you which file is problematic. Did you verify that it exist at that location?
and i just added .dll files..not .lib's
Which compiler are you using ? Which compiler was used to build OpenCV ?
i did my project with visual studio 2010. i want to make ainterface with Qt 5.1
Was OpenCV also built with VS2010 ?
yes. i run my program there. just i wanted to make inrterface to my program
Custom OpenCV build ?
amine last edited by
In order to overcome this pb you should just edit the compiler. According to the video you should choose Mingw Release.
Go to projects ( parameter compilation) and modify it!