Search code examples
opencvcaffe

openpose compilation tells undefined reference to cv::VideoCapture::VideoCapture(cv::String const&)


I have comipled caffe with GPU disabled,then

cp caffe/build/Makefile openpose/Makefile.conf

run

 make all -j 6

got these errors:

-- Generating done
-- Build files have been written to: /path/to/caffe/build
CXX/LD -o ._release/examples/tutorial_thread/1_openpose_read_and_display.bin
._release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::VideoCapture(cv::String const&)'
._release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::set(int, double)'
._release/lib/libopenpose.so: undefined reference to `op::renderPartAffinityFieldGpu(float*, op::PoseModel, cv::Size_<int> const&, float const*, cv::Size_<int> const&, float, int, float)'
._release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::release()'
._release/lib/libopenpose.so: undefined reference to `op::renderBodyPartsGpu(float*, op::PoseModel, cv::Size_<int> const&, float const*, cv::Size_<int> const&, float, float)'
._release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'

can't find opencv,and I compiled latest opencv 3.2-dev from source,all opencv programs(both c++ and python) worked,so why cann't openpose find opencv?


Solution

  • Caffe recognized opencv actually,those reference are method that were discarded in opencv3.2 ,but are available in opencv 3.1.0 or earlier version.i had the same problem while installing 3.2 and eventualy downgrading to 3.1.0 solved the issue for me,here is a nice guide to install opencv 3.1.0 and according to

    this discussion,it seems that the standard is to support opencv that are available in Ubuntu sources and i think you can't install opencv3.2 through apt-get by now,only need to build from source