Hi, while compiling the face-detect.cpp, I get the following error:
g++ pkg-config --cflags --libs opencv
face-detect.cpp -o face-detect
/tmp/ccDDga1V.o: In function main': face-detect.cpp:(.text+0x39): undefined reference to
cv::CommandLineParser::CommandLineParser(int, char const*, char const)'
face-detect.cpp:(.text+0x13b): undefined reference to cv::CascadeClassifier::CascadeClassifier()' face-detect.cpp:(.text+0x15f): undefined reference to
cv::CascadeClassifier::load(std::basic_string<char, std::char_traits, std::allocator > const&)'
face-detect.cpp:(.text+0x189): undefined reference to cv::format(char const*, ...)' face-detect.cpp:(.text+0x1d1): undefined reference to
cv::imread(std::basic_string<char, std::char_traits, std::allocator > const&, int)'
face-detect.cpp:(.text+0x1f9): undefined reference to cv::format(char const*, ...)' face-detect.cpp:(.text+0x24a): undefined reference to
cv::_OutputArray::OutputArray(cv::Mat&)'
face-detect.cpp:(.text+0x262): undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)' face-detect.cpp:(.text+0x28a): undefined reference to
cv::cvtColor(cv::InputArray const&, cv::OutputArray const&, int, int)'
face-detect.cpp:(.text+0x2a2): undefined reference to cv::_OutputArray::_OutputArray(cv::Mat&)' face-detect.cpp:(.text+0x2ba): undefined reference to
cv::InputArray::InputArray(cv::Mat const&)'
face-detect.cpp:(.text+0x2d2): undefined reference to cv::equalizeHist(cv::_InputArray const&, cv::_OutputArray const&)' face-detect.cpp:(.text+0x33a): undefined reference to
cv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rect, std::allocatorcv::Rect >&, double, int, int, cv::Size, cv::Size)'
face-detect.cpp:(.text+0x372): undefined reference to cv::format(char const*, ...)' face-detect.cpp:(.text+0x3e8): undefined reference to
cv::format(char const, ...)'
face-detect.cpp:(.text+0x4a6): undefined reference to cv::rectangle(cv::Mat&, cv::Rect_<int>, cv::Scalar_<double> const&, int, int, int)' face-detect.cpp:(.text+0x4ee): undefined reference to
cv::_InputArray::_InputArray(cv::Mat const&)'
face-detect.cpp:(.text+0x50a): undefined reference to cv::imwrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' face-detect.cpp:(.text+0x546): undefined reference to
cv::_InputArray::InputArray(cv::Mat const&)'
face-detect.cpp:(.text+0x562): undefined reference to cv::imwrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' face-detect.cpp:(.text+0x5af): undefined reference to
cv::format(char const, ...)'
face-detect.cpp:(.text+0x642): undefined reference to cv::CascadeClassifier::~CascadeClassifier()' face-detect.cpp:(.text+0x7c6): undefined reference to
cv::CascadeClassifier::~CascadeClassifier()'
/tmp/ccDDga1V.o: In function cv::Mat::~Mat()': face-detect.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x2b): undefined reference to
cv::fastFree(void*)'
/tmp/ccDDga1V.o: In function cv::Mat::clone() const': face-detect.cpp:(.text._ZNK2cv3Mat5cloneEv[cv::Mat::clone() const]+0x20): undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)'
face-detect.cpp:(.text._ZNK2cv3Mat5cloneEv[cv::Mat::clone() const]+0x32): undefined reference to cv::Mat::copyTo(cv::_OutputArray const&) const' /tmp/ccDDga1V.o: In function
cv::Mat::release()':
face-detect.cpp:(.text.ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x3b): undefined reference to cv::Mat::deallocate()' /tmp/ccDDga1V.o: In function
cv::Mat::operator()(cv::Rect const&) const':
face-detect.cpp:(.text.ZNK2cv3MatclERKNS_5Rect_IiEE[cv::Mat::operator()(cv::Rect const&) const]+0x1b): undefined reference to cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)' /tmp/ccDDga1V.o: In function
std::basic_string<char, std::char_traits, std::allocator > cv::CommandLineParser::get<std::basic_string<char, std::char_traits, std::allocator > >(std::basic_string<char, std::char_traits, std::allocator > const&, bool)':
face-detect.cpp:(.text._ZN2cv17CommandLineParser3getISsEET_RKSsb[std::basic_string<char, std::char_traits, std::allocator > cv::CommandLineParser::get<std::basic_string<char, std::char_traits, std::allocator > >(std::basic_string<char, std::char_traits, std::allocator > const&, bool)]+0x1b): undefined reference to cv::CommandLineParser::has(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' face-detect.cpp:(.text._ZN2cv17CommandLineParser3getISsEET_RKSsb[std::basic_string<char, std::char_traits<char>, std::allocator<char> > cv::CommandLineParser::get<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)]+0x48): undefined reference to
cv::CommandLineParser::getString(std::basic_string<char, std::char_traits, std::allocator > const&)'
face-detect.cpp:(.text._ZN2cv17CommandLineParser3getISsEET_RKSsb[std::basic_string<char, std::char_traits, std::allocator > cv::CommandLineParser::get<std::basic_string<char, std::char_traits, std::allocator > >(std::basic_string<char, std::char_traits, std::allocator > const&, bool)]+0x6c): undefined reference to `std::basic_string<char, std::char_traits, std::allocator > cv::CommandLineParser::analizeValue<std::basic_string<char, std::char_traits, std::allocator > >(std::basic_string<char, std::char_traits, std::allocator > const&, bool)'