views:

237

answers:

2

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 in my project, but I can't find them. Where does it put them?

I want to use eclipse as the ide programming in c++, but I am having problems finding out how to get it setup initially. I am new to programming in eclipse and ubuntu in general so if anyone has a step by step guide I would love to see it.

A: 

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.

Paul Kuliniewicz
A: 

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.

Eric Perko
ok, that explains why I couldnt find them. I was expecting to find actual .lib files ie a file like opencv.lib. Are lib*.so files in ubuntu the same thing as .lib files in windows?
Mr Bell
@Mr Bell: I'm not 100% what exactly a .lib file is on Windows, so can't really answer that. However, in Linux, a lib*.so corresponds to a shared library while a lib*.a corresponds to a static library. Hope that helps.
Eric Perko