3

保持问答方面:

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

在 /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:错误:缺少终止“字符

那么出了什么问题呢?看看我的回答。

4

2 回答 2

6

本错误报告中所述,问题是 cmake 的旧版本(2.8.2)。所以解决方案是获取 cmake 源的新副本,编译它并使用它来安装 OpenCV。

注意 18/09/2012:这也适用于带有 cmake 2.8.9 的 Ubuntu 12.04!

# 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

而已。

于 2012-07-13T12:17:02.167 回答
0

Unfortunately newer cmake depends on newer cmake than the outdated cmake 2.6-patch 0 in lenny. To compile cmake 2.8.8 as mentioned above, first you have to compile CMake 2.6.3 or above which builds with lenny outdated cmake 2.6-patch 0.

于 2013-02-18T22:08:24.193 回答