If you are not able to link with a library that is specified via pkg-config then make sure your pkg-config flag is placed in the end of the compiler/linker command
eg:
g++ -o "OpenCV2.3Test" ./main.o `pkg-config --libs opencv`
instead of
g++ `pkg-config --libs opencv` -o "OpenCV2.3Test" ./main.o
In Eclipse this is done by going to project properties -> CCC C++ Linker and change the order of the command line pattern so that flags are last, eg.:
${COMMAND} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${FLAGS}
Tags: eclipse, pkg-config, pkgconfig