erro “make” ao instalar o OpenCV

2
[ 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

Estou tentando instalar o OpenCV 2.2.0. Acho que segui todos os passos antes de executar make , mas sempre que digito make , não funciona e ocorrem 2 erros. Eu não sei porque isso está acontecendo. Por favor, deixe-me saber como corrigir isso.

    
por user305321 14.07.2014 / 08:32

1 resposta

0

Estou tentando descobrir por que você está usando a versão 2.4. Freqüentemente, os erros são secundários por natureza. Por exemplo, você pode não ter instalado dependências secundárias. Estes geralmente podem ser detectados prestando muita atenção aos avisos no processo de instalação.

Minha sugestão é excluir todas as coisas que o cmake criou e, em seguida, reexecutar o cmake. Quando terminar, role para o topo e verifique se tudo o que estava procurando foi encontrado. Se não for uma dependência strong, quando você compilar, simplesmente irá pular isso.

Para o caso de instalar uma versão mais antiga do software, como você está fazendo, certifique-se de que nenhuma das dependências seja mais nova que a versão mais antiga que você está tentando instalar. A maioria das versões mais recentes são compatíveis com o antigo, mas não podem testar tudo. De acordo com o DoD, o teste de 100% é efetivo de 60 a 80%.

    
por user3120401 08.08.2014 / 20:01