strange opencv.pc (pkg-config) file
===

I built opencv on Ubuntu 12.04 64bit.  I can link to opencv libraries if I issue the following command:

    g++ `pkg-config opencv --cflags` my_code.cpp  -o my_code `pkg-config opencv --libs` 

However if I issue the following command:

    gcc -g -O2 -W -Wall -Wno-unused -Wno-multichar  -o main main.o -lcxcore -lcv -lhighgui -lcvaux 

I get:

    /usr/bin/ld: cannot find -lcxcore
    /usr/bin/ld: cannot find -lcv
    /usr/bin/ld: cannot find -lhighgui
    /usr/bin/ld: cannot find -lcvaux
    collect2: ld returned 1 exit status

To trouble shoot the problem I issued:

    pkg-config --libs opencv 
and got:

/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so

I guess that explains the problem but I don't understand why opencv.pc doesn't include the short hand "-llib" format for library locations like a usual .pc file.  Any Ideas??


