OpenCV Compiling Issue - Undefined Refence

http://stackoverflow.com/questions/7816607/opencv-2-3-compiling-issue-undefined-refence-ubuntu-11-10

 

I am guessing that at least some of the libraries in the output of

pkg-config opencv --libs

are archive libraries. It is incorrect to put archive libraries before sources that need them (test_1.cppin this case): the order of sources and libraries on the link line matters.

Try

g++-o test_1 test_1.cpp `pkg-config opencv --cflags --libs`
posted @ 2014-01-05 00:11  ZhangAnam  阅读(155)  评论(0编辑  收藏  举报