[ 38%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/convert.o
In file included from /home/bomi/OpenCV/modules/core/src/precomp.hpp:55:0,
from /home/bomi/OpenCV/modules/core/src/convert.cpp:43:
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:354:13: error: ‘ptrdiff_t’ does not name a type
typedef ptrdiff_t difference_type;
^
In file included from /home/bomi/OpenCV/modules/core/src/precomp.hpp:55:0,
from /home/bomi/OpenCV/modules/core/src/convert.cpp:43:
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2600:13: error: ‘ptrdiff_t’ does not name a type
typedef ptrdiff_t difference_type;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2623:24: error: declaration of ‘operator[]’ as non-function
uchar* operator [](ptrdiff_t i) const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2623:22: error: expected ‘;’ at end of member declaration
uchar* operator [](ptrdiff_t i) const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2623:34: error: expected ‘)’ before ‘i’
uchar* operator [](ptrdiff_t i) const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2626:36: error: declaration of ‘operator+=’ as non-function
MatConstIterator& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2626:32: error: expected ‘;’ at end of member declaration
MatConstIterator& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2626:46: error: expected ‘)’ before ‘ofs’
MatConstIterator& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2628:36: error: declaration of ‘operator-=’ as non-function
MatConstIterator& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2628:32: error: expected ‘;’ at end of member declaration
MatConstIterator& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2628:46: error: expected ‘)’ before ‘ofs’
MatConstIterator& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2641:5: error: ‘ptrdiff_t’ does not name a type
ptrdiff_t lpos() const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2642:15: error: ‘ptrdiff_t’ has not been declared
void seek(ptrdiff_t ofs, bool relative=false);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2661:13: error: ‘ptrdiff_t’ does not name a type
typedef ptrdiff_t difference_type;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2684:21: error: ‘ptrdiff_t’ has not been declared
_Tp operator [](ptrdiff_t i) const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2687:37: error: declaration of ‘operator+=’ as non-function
MatConstIterator_& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2687:33: error: expected ‘;’ at end of member declaration
MatConstIterator_& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2687:47: error: expected ‘)’ before ‘ofs’
MatConstIterator_& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2689:37: error: declaration of ‘operator-=’ as non-function
MatConstIterator_& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2689:33: error: expected ‘;’ at end of member declaration
MatConstIterator_& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2689:47: error: expected ‘)’ before ‘ofs’
MatConstIterator_& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2733:22: error: declaration of ‘operator[]’ as non-function
_Tp& operator [](ptrdiff_t i) const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2733:20: error: expected ‘;’ at end of member declaration
_Tp& operator [](ptrdiff_t i) const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2733:32: error: expected ‘)’ before ‘i’
_Tp& operator [](ptrdiff_t i) const;
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2736:32: error: declaration of ‘operator+=’ as non-function
MatIterator_& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2736:28: error: expected ‘;’ at end of member declaration
MatIterator_& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2736:42: error: expected ‘)’ before ‘ofs’
MatIterator_& operator += (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2738:32: error: declaration of ‘operator-=’ as non-function
MatIterator_& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2738:28: error: expected ‘;’ at end of member declaration
MatIterator_& operator -= (ptrdiff_t ofs);
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:2738:42: error: expected ‘)’ before ‘ofs’
MatIterator_& operator -= (ptrdiff_t ofs);
^
In file included from /home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:4047:0,
from /home/bomi/OpenCV/modules/core/src/precomp.hpp:55,
from /home/bomi/OpenCV/modules/core/src/convert.cpp:43:
/home/bomi/OpenCV/modules/core/include/opencv2/core/operations.hpp:2822:15: error: ‘ptrdiff_t’ does not name a type
static inline ptrdiff_t operator - (const FileNodeIterator& it1, const FileNodeIterator& it2)
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/operations.hpp:3383:31: error: ‘ptrdiff_t’ does not name a type
template<typename _Tp> inline ptrdiff_t operator - (const SeqIterator<_Tp>& a,
^
In file included from /home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:4048:0,
from /home/bomi/OpenCV/modules/core/src/precomp.hpp:55,
from /home/bomi/OpenCV/modules/core/src/convert.cpp:43:
/home/bomi/OpenCV/modules/core/include/opencv2/core/mat.hpp:1629:57: error: declaration of ‘operator+=’ as non-function
inline MatConstIterator& MatConstIterator::operator += (ptrdiff_t ofs)
^
/home/bomi/OpenCV/modules/core/include/opencv2/core/mat.hpp:1629:57: error: ‘ptrdiff_t’ was not declared in this scope
/home/bomi/OpenCV/modules/core/include/opencv2/core/mat.hpp:1629:57: note: suggested alternatives:
In file included from /usr/include/c++/4.8/utility:68:0,
from /usr/include/c++/4.8/algorithm:60,
from /home/bomi/OpenCV/modules/core/include/opencv2/core/core.hpp:56,
from /home/bomi/OpenCV/modules/core/src/precomp.hpp:55,
from /home/bomi/OpenCV/modules/core/src/convert.cpp:43:
/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:187:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^
/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:187:28: note: ‘std::ptrdiff_t’
/home/bomi/OpenCV/modules/core/src/convert.cpp:1058:1: error: expected ‘}’ at end of input
}
^
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/convert.o] 오류 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] 오류 2
我正在尝试安装 OpenCV 2.2.0。我认为我在运行之前已经遵循了所有步骤make
,但每当我输入时make
,它都不起作用并且会出现 2 个错误。我不知道为什么会发生这种情况。请告诉我如何解决这个问题。
答案1
我正在尝试弄清楚您为什么使用 2.4 版本。错误通常都是次要的。例如,您可能没有安装次要依赖项。通常可以通过密切关注安装过程中的警告来检测这些错误。
我的建议是删除 cmake 创建的所有内容,然后重新运行 cmake。完成后,滚动到顶部并检查以确保已找到它所寻找的所有内容。如果它不是强依赖项,则在编译时,它会跳过它。
对于像您这样安装旧版本软件的情况,我会确保所有依赖项都比您尝试安装的旧版本更新。大多数新版本都与旧版本兼容,但它们无法测试所有内容。根据国防部的说法,100% 测试的有效性为 60-80%。