在 Ubuntu 14.04 中編譯 OpenCV 時發生錯誤

在 Ubuntu 14.04 中編譯 OpenCV 時發生錯誤

我按照編譯 opencv2.4.9 的說明進行操作在 Ubuntu 14.04、13.10 中安裝 OpenCV 2.4.9

我在建置過程中收到以下錯誤。有人可以告訴我如何修復它嗎?

/usr/bin/ld: ../../lib/libopencv_highgui.a(cap_libv4l.cpp.o): undefined reference to symbol 'v4l2_munmap'
//usr/lib/x86_64-linux-gnu/libv4l2.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_test_highgui] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2

答案1

早些時候,我從 opencv 網站上的鏈接下載了 zip 檔案形式的源代碼,但由於上述錯誤而無法建置。

我使用 git 檢查了原始程式碼並按照以下說明進行操作http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html

我仍然遇到同樣的錯誤,找到了這個解決方案作為解決方案。您需要將 -lv4l2 新增到下面連結中提到的文件中

http://code.opencv.org/issues/3726

相關內容