I found this error while running sample cpp example facedetect.cpp 'undefiend reference to cv:
edit
/tmp/ccbH13my.o: In function main': facedetect.cpp:(.text+0x10e): undefined reference tocv::VideoCapture::VideoCapture()'
facedetect.cpp:(.text+0x14a): undefined reference to cv::CascadeClassifier::CascadeClassifier()' facedetect.cpp:(.text+0x159): undefined reference tocv::CascadeClassifier::CascadeClassifier()'
facedetect.cpp:(.text+0x192): undefined reference to cv::CommandLineParser::CommandLineParser(int, char const* const*, cv::String const&)' facedetect.cpp:(.text+0x1d0): undefined reference tocv::CommandLineParser::has(cv::String const&) const'
facedetect.cpp:(.text+0x36c): undefined reference to cv::CommandLineParser::has(cv::String const&) const' facedetect.cpp:(.text+0x3ff): undefined reference tocv::CommandLineParser::check() const'
facedetect.cpp:(.text+0x415): undefined reference to cv::CommandLineParser::printErrors() const' facedetect.cpp:(.text+0x44e): undefined reference tocv::CascadeClassifier::load(cv::String const&)'
facedetect.cpp:(.text+0x4bd): undefined reference to cv::CascadeClassifier::load(cv::String const&)' facedetect.cpp:(.text+0x5be): undefined reference tocv::VideoCapture::open(int)'
facedetect.cpp:(.text+0x66c): undefined reference to cv::imread(cv::String const&, int)' facedetect.cpp:(.text+0x6ec): undefined reference tocv::VideoCapture::open(cv::String const&)'
facedetect.cpp:(.text+0x77e): undefined reference to cv::imread(cv::String const&, int)' facedetect.cpp:(.text+0x7ff): undefined reference tocv::VideoCapture::isOpened() const'
facedetect.cpp:(.text+0x836): undefined reference to cv::VideoCapture::operator>>(cv::Mat&)' facedetect.cpp:(.text+0x8c3): undefined reference tocv::waitKey(int)'
facedetect.cpp:(.text+0x9b3): undefined reference to cv::waitKey(int)' facedetect.cpp:(.text+0xafa): undefined reference tocv::imread(cv::String const&, int)'
facedetect.cpp:(.text+0xb8b): undefined reference to cv::waitKey(int)' facedetect.cpp:(.text+0xc19): undefined reference tocv::CommandLineParser::~CommandLineParser()'
facedetect.cpp:(.text+0xc28): undefined reference to cv::CascadeClassifier::~CascadeClassifier()' facedetect.cpp:(.text+0xc37): undefined reference tocv::CascadeClassifier::~CascadeClassifier()'
facedetect.cpp:(.text+0xc73): undefined reference to cv::VideoCapture::~VideoCapture()' facedetect.cpp:(.text+0xe0e): undefined reference tocv::CommandLineParser::~CommandLineParser()'
facedetect.cpp:(.text+0xe22): undefined reference to cv::CascadeClassifier::~CascadeClassifier()' facedetect.cpp:(.text+0xe36): undefined reference tocv::CascadeClassifier::~CascadeClassifier()'
facedetect.cpp:(.text+0xe77): undefined reference to cv::VideoCapture::~VideoCapture()' /tmp/ccbH13my.o: In functiondetectAndDraw(cv::Mat&, cv::CascadeClassifier&, cv::CascadeClassifier&, double, bool)':
facedetect.cpp:(.text+0x1123): undefined reference to cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' facedetect.cpp:(.text+0x11de): undefined reference tocv::resize(cv::_InputArray const&, cv::OutputArray const&, cv::Size, double, double, int)'
facedetect.cpp:(.text+0x1247): undefined reference to cv::equalizeHist(cv::_InputArray const&, cv::_OutputArray const&)' facedetect.cpp:(.text+0x126a): undefined reference tocv::getTickCount()'
facedetect.cpp:(.text+0x1310): undefined reference to cv::CascadeClassifier::detectMultiScale(cv::_InputArray const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, double, int, int, cv::Size_<int>, cv::Size_<int>)' facedetect.cpp:(.text+0x1380): undefined reference tocv::flip(cv::InputArray const&, cv::OutputArray const&, int)'
facedetect.cpp:(.text+0x1433): undefined reference to cv::CascadeClassifier::detectMultiScale(cv::_InputArray const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, double, int, int, cv::Size_<int>, cv::Size_<int>)' facedetect.cpp:(.text+0x155f): undefined reference tocv::getTickCount()'
facedetect.cpp:(.text+0x1599): undefined reference to cv::getTickFrequency()' facedetect.cpp:(.text+0x17dc): undefined reference tocv::circle(cv::InputOutputArray const&, cv::Point, int, cv::Scalar const&, int, int, int)'
facedetect ...
(more)
I am not sure but there may be problem with linker.