在 ubuntu 14.04 LTS 中安装 opencv 2.4.10 时出现未定义的引用错误
undefined reference error while installing opencv 2.4.10 in ubuntu 14.04 LTS
我在我的 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
尝试以下选项:
改用 OpenCV 2.4.9
运行 sudo apt-get install libv4l-dev
或使用以下步骤,我已成功使用这些步骤在 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
我在我的 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
尝试以下选项:
改用 OpenCV 2.4.9
运行
sudo apt-get install libv4l-dev
或使用以下步骤,我已成功使用这些步骤在 Ubuntu 14.04、12.04 和 Debian Wheezy
中安装 OpenCVsudo 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