基本上,我正尝试在 Ubuntu 8.10 上通过 CMake 构建 opencv 2.0。它一直说我的系统上缺少 libunicap、libucil 和 libv4l1。我在 Synaptic Package Manager 等地方搜索了这些库的软件包,但除了http://packages.ubuntu.com有一些类似的,例如 libunicap2 libucil2 ,由于“安装错误:依赖项无法满足”而无法安装在我的 Ubuntu 上。
以下是 CMake 报告的缺少的库信息:
$ cmake -D CMAKE\_BUILD\_TYPE=RELEASE -D CMAKE\_INSTALL\_PREFIX=/usr/local -D BUILD\_PYTHON\_SUPPORT=ON ..
-- Detected version of GNU GCC: 43
-- checking for module 'libunicap'
-- package 'libunicap' not found
-- checking for module 'libucil'
-- package 'libucil' not found
-- checking for module 'libv4l1'
-- package 'libv4l1' not found
-- IPP detected:
-- Parsing 'cvconfig.h.cmake'
running mkdir -p "/home/tim/program_files/tim/OpenCV-2.0.0/release/unix-install/" 2>&1
--
-- General configuration for opencv 2.0.0 =====================================
--
-- Compiler:
-- C++ flags (Release): -Wall -pthread -ffunction-sections -O3 -DNDEBUG -fomit-frame-pointer -O3 -ffast-math -mmmx -DNDEBUG
-- C++ flags (Debug): -Wall -pthread -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
--
-- GUI:
-- GTK+ 2.x: 1
-- GThread: 1
--
-- Image I/O:
-- JPEG: TRUE
-- PNG: TRUE
-- TIFF: TRUE
-- JASPER: TRUE
--
-- Video I/O:
-- DC1394 1.x:
-- DC1394 2.x: 1
-- FFMPEG: 1
-- codec: 1
-- format: 1
-- util: 1
-- swscale: 1
-- gentoo-style:
-- GStreamer: 1
-- UniCap:
-- V4L/V4L2: 1/1
-- Xine: 1
--
-- Interfaces:
-- Old Python: 0
-- Python: ON
-- Use IPP: NO
-- Build Documentation 0
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /home/tim/program_files/tim/OpenCV-2.0.0/release
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generatim done
-- Build files have been written to: /home/tim/program_files/tim/OpenCV-2.0.0/release
我还尝试安装早期版本的 OpenCV 所指定的预要求库(我在网上找到的),但发现它们已经安装好了:
$ sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgtk2.0-dev is already the newest version.
libavcodec-dev is already the newest version.
libavformat-dev is already the newest version.
libjpeg62-dev is already the newest version.
libtiff4-dev is already the newest version.
The following packages were automatically installed and are no longer required:
dnsmasq-base ttf-liberation
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
所以我很困惑。有人能给我一些建议吗?
感谢致敬!
答案1
不幸的是,ubuntu hardy 没有 unicap 和 ucil 包。这并不意味着您无法在应用程序中编译和使用 openCV-2.0,而只是您将无法使用这些特定库提供的功能。
运行 cmake 后,您只需使用以下命令编译并安装 OpenCV:
$ make
$ sudo make install
来自执行 cmake 的同一目录。
然后,您可以按照 INSTALL 文件最后一部分中的信息编译并将您的应用程序与 OpenCV 链接起来。