在ubuntu 14.04 LTS中安装opencv 2.4.10时出现未定义的引用错误

时间:2015-02-15 03:47:20

标签: opencv ubuntu

我在32位hp Pavilion dv4000笔记本电脑上使用Ubuntu 14.04 LTS。我正在尝试安装OpenCV 2.4.10,但即使遵循了许多教程,我也会遇到同样的错误。   当我给“make”命令安装opencv时,终端在17%完成后终止此错误。任何人都可以建议我如何解决它?

 Linking CXX executable ../../bin/opencv_perf_imgproc
//usr/local/lib/libv4l2.so.0: undefined reference to `v4lconvert_fixup_fmt'
//usr/local/lib/libv4l2.so.0: undefined reference to `v4lconvert_vidioc_s_ext_ctrls'
//usr/local/lib/libv4l2.so.0: undefined reference to `v4lconvert_vidioc_g_ext_ctrls'
//usr/local/lib/libv4l2.so.0: undefined reference to `v4lconvert_vidioc_try_ext_ctrls'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_imgproc] Error 1
make[1]: *** [modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/all] Error 2
make: *** [all] Error 2

1 个答案:

答案 0 :(得分:0)

尝试以下选项:

  1. 使用OpenCV 2.4.9代替

  2. 运行sudo apt-get install libv4l-dev

  3. 或者使用以下步骤,我已成功使用它在Ubuntu 14.04,12.04和Debian Wheezy中安装OpenCV

    sudo apt-get install build-essential make cmake git libgtk2.0-dev pkg-config python python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libtiff-dev
    cd ~/Downloads
    git clone https://github.com/itseez/opencv
    mv opencv /opt
    cd /opt/opencv
    git checkout 2.4.10.1 #or whatever version you want
    sudo mkdir build
    cd build
    sudo cmake -j4 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
    sudo make -j4
    sudo make -j4 install
    sudo ldconfig
    

    请参阅此http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html