Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
[ 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

I'm trying to install OpenCV 2.2.0. I think that I followed all the steps before I ran make, but whenever I type make, it doesn't work and 2 errors occur. I don't know why it is happening. Please let me know how to fix this.

share|improve this question
    
what is your ubuntu version? you need opencv 2.2 not 2.4. isnt it? –  user308564 Jul 14 at 7:29

1 Answer 1

I'm trying to figure out why you are using version 2.4. Errors often are secondary in nature. For example, you may have not installed secondary dependencies. These usually can be detected by paying close attention to the warnings in the installation process.

My suggestion is to delete all of the stuff that cmake created and then rerun cmake. When it is done, scroll to the top and check to make sure everything it was looking for had been found. If it isn't a strong dependency, when you compile, it will just skip that.

For the case of installing an older version of the software such as you are doing, I would make sure none of the dependencies are newer than the older version you are trying to install. Most newer versions are compatible with the old, but they can't test everything. According to the DoD 100% testing is 60-80% effective.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.