为Debian Lenny编译OpenCV 2.4.2 [英] Compile OpenCV 2.4.2 for Debian Lenny

查看:174
本文介绍了为Debian Lenny编译OpenCV 2.4.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要保留问答方面:

我遇到了最新版本(v.2.4.2)OpenCV版本的一个奇怪问题,无法安装时出现以下错误:

I got a strange problem with the latest (v.2.4.2) OpenCV version, which failed to install with the following error:


在/OpenCV-2.4.2/modules/core/src/system包含的文件.cpp:460:

/OpenCV-2.4.2/release/modules/core/version_string.inc:37:1:
警告:缺少终止字符从
/OpenCV-2.4.2/modules/core/src/system.cpp:460:
/OpenCV-2.4.2/release/modules/core/version_string.inc:37:错误:
缺失终止字符

In file included from /OpenCV-2.4.2/modules/core/src/system.cpp:460:
/OpenCV-2.4.2/release/modules/core/version_string.inc:37:1: warning: missing terminating " character In file included from /OpenCV-2.4.2/modules/core/src/system.cpp:460: /OpenCV-2.4.2/release/modules/core/version_string.inc:37: error: missing terminating " character

那么出了什么问题?

推荐答案

这个bug报告问题是一个旧版本(2.8.2)的cmake。所以解决方案是抓住一个新的cmake源副本,编译并使用它安装OpenCV。

As mentioned in this bug report the problem is an old version (2.8.2) of cmake. So the solution was to grab a fresh copy of the cmake source, compile it and use it to install OpenCV.

注意18/09/2012:这也可以在Ubuntu 12.04上使用cmake 2.8.9!

Note 18/09/2012: This also works on Ubuntu 12.04 with cmake 2.8.9!

# get the cmake src
wget http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz

# extract archive
tar xfvz cmake-2.8.8.tar.gz

# build the new version
cd cmake-2.8.8
cmake . 
make 
sudo make install

# get the OpenCV src
wget -O OpenCV-2.4.2.tar.bz2 http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.2/OpenCV-2.4.2.tar.bz2/download

# extract it …
tar -xvf OpenCV-2.4.2.tar.bz2

# build it
mkdir build
cd build
/usr/local/bin/cmake -D CMAKE_BUILD_TYPE=RELEASE ..
make
sudo make install

# setup OpenCV
sudo echo "/usr/local/lib" >> /etc/ld.so.conf
sudo ldconfig

就是这样。

这篇关于为Debian Lenny编译OpenCV 2.4.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆