I have ubuntu 10 installed. I installed all the opencv packages I could find in the software center. I expect that it installs some .lib files somewhere that I can reference i
dpkg -L opencv
will give you a list of all files installed from the opencv package. Be warned, however, that it won't show files that aren't in the package itself but get generated when the package is installed. Not being familiar with opencv, I don't know whether this will be a problem for you.
OpenCV libraries are installed as in .a(static library) or .so(dynamic library) format.
You can find OpenCV2 (i.e. C++ version) libraries (e.g. libopencv_core.so,libopencv_highgui.so etc) at /usr/local/lib
. If you want libraries for c version only (e.g. libcv.a,libcxcore.a etc) you can find them at /usr/lib
.
You can find the proper link flags using pkg-config --libs opencv
and the proper includes using pkg-config --cflags opencv
.
The actual libraries should be installed in /usr/lib and having names such as libhighgui.a or libhighgui.so, but you likely won't have to reference those directly. Just use the output of the above commands in the proper place in Eclipse for setting link flags and include directories. If you really do want to know which libs are OpenCV related, the output of pkg-config --libs opencv
will give you the names. For example, one of the outputs of that command is -lhighgui, so we know there should be a file named libhighgui.so
in /usr/lib.
I haven't used Eclipse in a while for C or C++, so I can't remember where those options are, but they are around somewhere.
As stated by Eric
pkg-config --libs opencv
will return libs to be included and if it is about the include file paths
it is /usr/include/opencv
and if you want it to be automatically added just add following to command along with the command by Eric --cflags
to above command.
Eg. let the file to be compiled be test.c then whole command will be
g++ test.c `pkg-config --libs --cflags opencv`
hope it helps.