undefined reference to `cvHaarDetectObjects'()(人脸检测)

这是网络下载的人脸识别程序:

       1.  这是Windows+qt+opencv    .pro文件(http://download.csdn.net/detail/liuguangzhou123/4590981)

INCLUDEPATH += /usr/local/include  \
                /usr/local/include/opencv \
                /usr/local/include/opencv2

LIBS += /usr/local/lib/libopencv_highgui.so \
        /usr/local/lib/libopencv_core.so \
      #  /usr/local/lib/libopencv_objdetect.so \
        /usr/local/lib/libopencv_imgproc.so \
    2   改成:这是ubuntu+qt+opencv    .pro文件
QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

INCLUDEPATH += /usr/local/include  \
                /usr/local/include/opencv \
                /usr/local/include/opencv2

LIBS += /usr/local/lib/libopencv_highgui.so \
        /usr/local/lib/libopencv_core.so \
      
        /usr/local/lib/libopencv_imgproc.so \

TARGET = CamaraGet
TEMPLATE = app


SOURCES += main.cpp\
        widget.cpp

HEADERS  += widget.h

FORMS    += widget.ui

提示:undefined reference to `cvHaarDetectObjects'()
    后来找到是参考 http://blog.csdn.net/moc062066/article/details/6651985#plain: 发现是忘添加libopencv_objdetect.so 文件。
 /usr/local/lib/libopencv_objdetect.so 


正确pro文件:

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

#INCLUDEPATH += D:/opencv2.1/include/opencv
#LIBS += -LD:/opencv2.1/lib/ -lcv210 -lcvaux210 -lhighgui210 -lcxcore210

INCLUDEPATH += /usr/local/include  \
                /usr/local/include/opencv \
                /usr/local/include/opencv2

LIBS += /usr/local/lib/libopencv_highgui.so \
        /usr/local/lib/libopencv_core.so \
        /usr/local/lib/libopencv_objdetect.so \
        /usr/local/lib/libopencv_imgproc.so \




TARGET = CamaraGet
TEMPLATE = app


SOURCES += main.cpp\
        widget.cpp

HEADERS  += widget.h

FORMS    += widget.ui


csdn:源代码下载路径(工程转换):http://download.csdn.net/detail/zyh821351004/8398195

CamaraGet_facedetect_qt_ubuntu_opencv.zip








你可能感兴趣的:(undefined reference to `cvHaarDetectObjects'()(人脸检测))