Including OpenCV library files to Qt in ubuntu
-
qmakes "LIBS":http://doc.qt.nokia.com/latest/qmake-variable-reference.html#libs variable can be used to add additional libraries.
@
LIBS += -L<path_to_libraries>
LIBS += -l<library>
@ -
- Open your project in Qt Creator.
- In the panel "Projects" click on the file ...pro.
- add there:
@
LIBS += -lyour_lib1
LIBS += -lyour_lib2
LIBS += -lyour_lib3
...
@
or
@
LIBS += -Lpath1
LIBS += -Lpath2
...
@
Lukas explained the format: capital L - all libraries from the path; low L (l) - one library; -
[quote author="Fomand" date="1315205373"]capital L - all libraries from the path
[/quote]I think this statement is not completely right.
Capital 'L' defines a library path. Lower case 'l' defines individual libraries.
However, defining the path of libs with 'L' provides certainly the location to search for libs, which might be added using 'l'. The documentation does not state that all libs under that path will be used. -
if you've installed OpenCV properly, it would probably reside somewhere in /usr/lib, /lib, /usr/local/lib. But I won't guarantee, I've never used it. Might as well be in /home/<username>/opencv/lib or similar.
But, if everything is installed properly, you would just have to
@
#include <cv.h>
@ -
Read this about OpenCV file names "here":http://packages.debian.org/source/sid/opencv .
And I am on Debian currently - not on Ubuntu. -
i think u dont understand the question
to use the opencv lirary in Qt for example
#include<highgui.hpp> the path of the particular header file has to be specified in the Qt
how to tell qt where to look for the header file
inbuilt header files can be directly but that of opencv cant -
Please be patient when waiting for answers. While we understand that you need help, we're all doing this on our free time and will help you as we can. Begging does not speed things up.
You need to add your path to your OpenCV header files in the "INCLUDEPATH":http://doc.qt.nokia.com/latest/qmake-variable-reference.html#includepath variable in your .pro file.
-
If you have downloaded the source tarball from the OpenCV website you will have to build the library first. There is an extensive "InstallGuide":http://opencv.willowgarage.com/wiki/InstallGuide right where you downloaded OpenCV.
If you have installed OpenCV using your distributions package manager (preferred) the library is already built and installed at the proper location. Use @dpkg --listfiles name-of-opencv-package@ to verify that the libraries have been installed to /usr/lib.
-
!http://photos.cc.fbcdn.net/hphotos-cc-ash4/299125_212360362157627_100001509941792_597819_483414201_n.jpg!
cant understand what the error is[EDIT: fixed image link, Volker]
-
[quote author="a4able" date="1315554387"]!http://photos.cc.fbcdn.net/hphotos-cc-ash4/299125_212360362157627_100001509941792_597819_483414201_n.jpg()!
cant understand what the error is[/quote]This does not look Qt-related in any way, you are not using any Qt libs in your project. Does imgshow() require cv::Mat, or maybe a pointer? Or maybe methods do not expect char *[] strings?