I installed Ubuntu a few days ago and used apt-get to install build_essentials, opencv, highgui, etc. g ++ - 4.6.1, opencv - 2.1.0. I did not create opencv from source code ..
We have software that uses opencv functionality. Suppose the source files are called a.cpp and b.cpp. I compile ao and bo files and then put them in the .so library (name it libab.so).
Finally, there is a file with the main one in it (name it z.cpp). I try to create an executable from it, but I get a ton of "undefined links" to cv :: stuff. My link line looks something like this:
g++ -fPIC -g z.cpp -L../lib -lab -lml -lcvaux -lhighgui -lcv -lcxcore -o z.out
then I get undefined help errors (all of which relate to cv :: stuff).
The interesting part is that if I directly contact my .o files, it builds just fine. So:
g++ -fPIC -g z.cpp a.o b.o -lml -lcvaux -lhighgui -lcv -lcxcore -o z.out
works.
Everything I read seems to imply that this is most likely a link binding problem, but I tried all the ordering permutations and got the same problem, so I really don't think this is my problem, but I could still be wrong. Does anyone have any ideas how I can build this with my library, and why will it work differently if I build with a full set of .o files that are in the library successfully but cannot build with the library itself?
daroo source
share