1- handling mouse's event , 2- downloaded library and didn't work
-
Linker errors => LIBS is wrong, you have not told qmake which OpenCV libraries you want linked (-l options), just where to find them (-L options).
-
Sorry didn't understand what you've said :(
I followed your comment before but still it's not working:
@
INCLUDEPATH += C:/Users/myuser/Downloads/Programs/opencv/build/include/
LIBS +=-LC:/Users/myuser/Downloads/Programs/opencv/build/x86/vc11/staticlib/@should I copy every name of the libs and replace -L with -l ? can I just include the whole file ? how ?
-
I downloaded a new version , and found two folders one for the source and I assumed it's for those who wants to build one , and the build folder which is the one that I used , put this in my pro file:
@
INCLUDEPATH += C:/opencv/build/include
LIBS +=-LC:/opencv/build/x86/vc11/staticlib
CONFIG(debug, debug|release){
LIBS +=-lopencv_core249
LIBS +=-lopencv_core249d
LIBS +=-lopencv_highgui249
LIBS +=-lopencv_highgui249d\}@
and found this error:
@
:-1: error: LNK1104: cannot open file '+=-lopencv_core249d.obj'
@ -
Hi,
@
LIBS +=-lopencv_core249
LIBS +=-lopencv_core249d
LIBS +=-lopencv_highgui249
LIBS +=-lopencv_highgui249d
@Should be
@
CONFIG(debug, debug|release){
LIBS +=
-lopencv_core249d
-lopencv_highgui249d
}CONFIG(release, debug|release){
LIBS +=
-lopencv_core249
-lopencv_highgui249d
@Using a backslashe after every line just concatenates them
-
Thanks , I'll restart my computer then try your solution , hopefully it'll work.
-
Well it didn't work :(
now it shows about 211 errors along with the ones before , can I just compile my own opencv ? I've been following a lot of tutorials on how to do so but I have no luck completing it , always shows an error in the cmake gui :(
-
Well , I still have the same problem maybe a little more :(
I've tried in the pro file:
@
INCLUDEPATH += C:/opencv249/build/include
LIBS +=-LC:/opencv249/build/x64/vc12/staticlib
CONFIG(debug,debug|release){
LIBS+=
-lopencv_core249d
-lopencv_highgui249d
}
CONFIG(debug,debug|release){
LIBS+=
-lopencv_core249
-lopencv_highgui249
}@
included:
@
#include<opencv/cv.h>
#include<opencv/highgui.h>
@wrote this code " an example "
@
IplImage*img=cvLoadImage("C:\Users\myuser\QT\build-CaptureTools-Unnamed-Debug\Fri May 2 2014_3039.png");
cvNamedWindow("example",CV_WINDOW_AUTOSIZE);
cvShowImage("example",img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("example");
@these errors happens:
@
C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvReleaseImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvNamedWindow referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvShowImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvDestroyWindow referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvLoadImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvWaitKey referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
debug\CaptureTools.exe:-1: error: LNK1120: 6 unresolved externals
@
-
Well new problem after following a solution from a guy in qt center website:
when using debug mode:
:-1: error: LNK1104: cannot open file 'opencv_core246d.lib'when using release mode:
:-1: error: LNK1104: cannot open file 'opencv_core246.lib' -
What version of Qt did you install and what compiler are you using ?
The last problem is a typo ? You have OpenCV 2.4.9 and you have linked to the 2.4.6 library
-
I'm using Qt 5.1.1 I built it statically , the compiler is msvc11 x86
Yeah , I fixed the last problem ,I even downloaded another version but still the same problem..
-
for anyone with the same problem:
I followed what he said and I think it's working now " need to test it more " but at least it compiled without errors"