build problem on ubuntu 10.04 64bit

40 views
Skip to first unread message

Rekveld

unread,
Jul 18, 2010, 9:18:04 PM7/18/10
to ctypes-opencv
Hi all,

I'm sorry to bother you with this, but I've been trying to build
pyopencv on Ubuntu 10.04 64bit for some hours now, and I don't
understand what's wrong. I followed all the steps from the Wiki, all
very clear and no problems there (except that if I use the most recent
OpenCv from the repository, it seems that there is no
BUILD_SWIG_PYTHON_SUPPORT anymore, but now I'm trying with a less
recent version 2.1.0).

When i do 'python setup.py build' however, all starts fine, it builds
a couple of libraries in the bin.v2 directory in my Boost_1_43_0-
directory, but as soon as it really starts compiling pyopencvext, I
get myriads of errors like these below and none of the libs actually
get built.
What is going wrong ?

kind regards,

Joost.


here a snippet of the errors I get (I get multiple pages of these per
second during the whole compilation, most of it are complaints about
classes being redefined):


pyopencv/pyopencvext/sdopencv/sdcv.hpp:894: error: redefinition of
‘class cv::StereoBM’
/usr/local/include/opencv2/calib3d/calib3d.hpp:650: error: previous
definition of ‘class cv::StereoBM’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:912: error: redefinition of
‘class cv::StereoSGBM’
/usr/local/include/opencv2/calib3d/calib3d.hpp:675: error: previous
definition of ‘class cv::StereoSGBM’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:951: error: default argument
given for parameter 5 of ‘void cv::validateDisparity(cv::Mat&, const
cv::Mat&, int, int, int)’
/usr/local/include/opencv2/calib3d/calib3d.hpp:718: error: after
previous specification in ‘void cv::validateDisparity(cv::Mat&, const
cv::Mat&, int, int, int)’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:955: error: default argument
given for parameter 4 of ‘void cv::reprojectImageTo3D(const cv::Mat&,
cv::Mat&, const cv::Mat&, bool)’
/usr/local/include/opencv2/calib3d/calib3d.hpp:723: error: after
previous specification in ‘void cv::reprojectImageTo3D(const cv::Mat&,
cv::Mat&, const cv::Mat&, bool)’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:957: error: redefinition of
‘class cv::KeyPoint’
/usr/local/include/opencv2/features2d/features2d.hpp:209: error:
previous definition of ‘class cv::KeyPoint’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:981: error: redefinition of
‘class cv::SURF’
/usr/local/include/opencv2/features2d/features2d.hpp:332: error:
previous definition of ‘class cv::SURF’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:998: error: redefinition of
‘class cv::MSER’
/usr/local/include/opencv2/features2d/features2d.hpp:362: error:
previous definition of ‘class cv::MSER’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1010: error: redefinition of
‘class cv::StarDetector’
/usr/local/include/opencv2/features2d/features2d.hpp:381: error:
previous definition of ‘class cv::StarDetector’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1026: error: redefinition of
‘class CvLevMarq’
/usr/local/include/opencv2/calib3d/calib3d.hpp:390: error: previous
definition of ‘class CvLevMarq’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1065: error: redefinition of
‘struct lsh_hash’
/usr/local/include/opencv2/imgproc/imgproc.hpp:839: error: previous
definition of ‘struct lsh_hash’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1069: error: redefinition of
‘struct CvLSHOperations’
/usr/local/include/opencv2/imgproc/imgproc.hpp:844: error: previous
definition of ‘struct CvLSHOperations’

"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -
Wall -O3 -fPIC -Wno-strict-aliasing -I/usr/local/include/opencv -I/
home/joost/OpenCV/boost_1_43_0 -Ipyopencv -Ipyopencv/pyopencvext -
Ipyopencv/pyopencvext/numpy_include -Ipyopencv/pyopencvext/core -
Ipyopencv/pyopencvext/sdopencv -DBOOST_PYTHON_STATIC_LIB -DNDEBUG -
I"/home/joost/OpenCV/boost_1_43_0" -I"/usr/include/python2.6" -c -o
"bin/gcc-4.4.3/release/link-static/pyopencv/pyopencvext/
pyopencvext_free_functions_gete.pypp.o" "pyopencv/pyopencvext/
pyopencvext_free_functions_gete.pypp.cpp"

...failed gcc.compile.c++ bin/gcc-4.4.3/release/link-static/pyopencv/
pyopencvext/pyopencvext_free_functions_gete.pypp.o...

Minh-Tri Pham

unread,
Jul 19, 2010, 2:38:59 AM7/19/10
to ctypes...@googlegroups.com
Hi Joost,

The problem is PyOpenCV is only compatible with the release versions of
OpenCV (i.e. 2.0, 2.1.0) and not the current version in the repository. There
are so many changes going on in OpenCV's repository and I can't find enough
time to follow them. That's why you have received many compilation errors.

Cheers,
Minh-Tri

On 7/19/2010 2:18 AM, Rekveld wrote:
> Hi all,
>
> I'm sorry to bother you with this, but I've been trying to build
> pyopencv on Ubuntu 10.04 64bit for some hours now, and I don't
> understand what's wrong. I followed all the steps from the Wiki, all
> very clear and no problems there (except that if I use the most recent
> OpenCv from the repository, it seems that there is no
> BUILD_SWIG_PYTHON_SUPPORT anymore, but now I'm trying with a less
> recent version 2.1.0).
>
> When i do 'python setup.py build' however, all starts fine, it builds
> a couple of libraries in the bin.v2 directory in my Boost_1_43_0-
> directory, but as soon as it really starts compiling pyopencvext, I
> get myriads of errors like these below and none of the libs actually
> get built.
> What is going wrong ?
>
> kind regards,
>
> Joost.
>
>
> here a snippet of the errors I get (I get multiple pages of these per
> second during the whole compilation, most of it are complaints about
> classes being redefined):
>
>
> pyopencv/pyopencvext/sdopencv/sdcv.hpp:894: error: redefinition of

> �class cv::StereoBM�
> /usr/local/include/opencv2/calib3d/calib3d.hpp:650: error: previous
> definition of �class cv::StereoBM�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:912: error: redefinition of

> �class cv::StereoSGBM�
> /usr/local/include/opencv2/calib3d/calib3d.hpp:675: error: previous
> definition of �class cv::StereoSGBM�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:951: error: default argument

> given for parameter 5 of �void cv::validateDisparity(cv::Mat&, const
> cv::Mat&, int, int, int)�
> /usr/local/include/opencv2/calib3d/calib3d.hpp:718: error: after
> previous specification in �void cv::validateDisparity(cv::Mat&, const
> cv::Mat&, int, int, int)�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:955: error: default argument

> given for parameter 4 of �void cv::reprojectImageTo3D(const cv::Mat&,
> cv::Mat&, const cv::Mat&, bool)�
> /usr/local/include/opencv2/calib3d/calib3d.hpp:723: error: after
> previous specification in �void cv::reprojectImageTo3D(const cv::Mat&,
> cv::Mat&, const cv::Mat&, bool)�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:957: error: redefinition of

> �class cv::KeyPoint�
> /usr/local/include/opencv2/features2d/features2d.hpp:209: error:
> previous definition of �class cv::KeyPoint�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:981: error: redefinition of

> �class cv::SURF�
> /usr/local/include/opencv2/features2d/features2d.hpp:332: error:
> previous definition of �class cv::SURF�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:998: error: redefinition of

> �class cv::MSER�
> /usr/local/include/opencv2/features2d/features2d.hpp:362: error:
> previous definition of �class cv::MSER�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1010: error: redefinition of

> �class cv::StarDetector�
> /usr/local/include/opencv2/features2d/features2d.hpp:381: error:
> previous definition of �class cv::StarDetector�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1026: error: redefinition of

> �class CvLevMarq�
> /usr/local/include/opencv2/calib3d/calib3d.hpp:390: error: previous
> definition of �class CvLevMarq�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1065: error: redefinition of

> �struct lsh_hash�
> /usr/local/include/opencv2/imgproc/imgproc.hpp:839: error: previous
> definition of �struct lsh_hash�


> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1069: error: redefinition of

> �struct CvLSHOperations�
> /usr/local/include/opencv2/imgproc/imgproc.hpp:844: error: previous
> definition of �struct CvLSHOperations�


>
> "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -
> Wall -O3 -fPIC -Wno-strict-aliasing -I/usr/local/include/opencv -I/
> home/joost/OpenCV/boost_1_43_0 -Ipyopencv -Ipyopencv/pyopencvext -
> Ipyopencv/pyopencvext/numpy_include -Ipyopencv/pyopencvext/core -
> Ipyopencv/pyopencvext/sdopencv -DBOOST_PYTHON_STATIC_LIB -DNDEBUG -
> I"/home/joost/OpenCV/boost_1_43_0" -I"/usr/include/python2.6" -c -o
> "bin/gcc-4.4.3/release/link-static/pyopencv/pyopencvext/
> pyopencvext_free_functions_gete.pypp.o" "pyopencv/pyopencvext/
> pyopencvext_free_functions_gete.pypp.cpp"
>
> ...failed gcc.compile.c++ bin/gcc-4.4.3/release/link-static/pyopencv/
> pyopencvext/pyopencvext_free_functions_gete.pypp.o...
>

--
Dr. Minh-Tri Pham
Research Fellow, University of Surrey, UK
Email: t.p...@surrey.ac.uk or pmt...@gmail.com
Mob: +44 (0) 778 774 1089 | Tel: +44 (0) 148 368 4711

Rekveld

unread,
Jul 19, 2010, 4:13:36 AM7/19/10
to ctypes-opencv
Hi Minh-Tri,

thanks a lot for your reply and for your fantastic work on pyopencv.
That makes total sense, but now, with a freshly built OpenCV 2.1.0 and
with a downloaded pyopencv2.1.0.wr.1.1.0, I still get the same errors,
or at least, errors that are as plentiful, see snippet below that I
have seen pass by many times.
Do I need to uninstall/delete something before being able to install
again ? Can it be that I have some other python bindings installed
which are interfering with this installation ?

best,

Joost.








pyopencv/pyopencvext/sdopencv/sdcv.hpp:981: error: redefinition of
‘class cv::SURF’
/usr/local/include/opencv2/features2d/features2d.hpp:332: error:
previous definition of ‘class cv::SURF’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:998: error: redefinition of
‘class cv::MSER’
/usr/local/include/opencv2/features2d/features2d.hpp:362: error:
previous definition of ‘class cv::MSER’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1010: error: redefinition of
‘class cv::StarDetector’
/usr/local/include/opencv2/features2d/features2d.hpp:381: error:
previous definition of ‘class cv::StarDetector’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1026: error: redefinition of
‘class CvLevMarq’
/usr/local/include/opencv2/calib3d/calib3d.hpp:390: error: previous
definition of ‘class CvLevMarq’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1065: error: redefinition of
‘struct lsh_hash’
/usr/local/include/opencv2/imgproc/imgproc.hpp:839: error: previous
definition of ‘struct lsh_hash’
pyopencv/pyopencvext/sdopencv/sdcv.hpp:1069: error: redefinition of
‘struct CvLSHOperations’
/usr/local/include/opencv2/imgproc/imgproc.hpp:844: error: previous
definition of ‘struct CvLSHOperations’
> > class cv::StereoBM
> > /usr/local/include/opencv2/calib3d/calib3d.hpp:650: error: previous
> > definition of class cv::StereoBM
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:912: error: redefinition of
> > class cv::StereoSGBM
> > /usr/local/include/opencv2/calib3d/calib3d.hpp:675: error: previous
> > definition of class cv::StereoSGBM
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:951: error: default argument
> > given for parameter 5 of void cv::validateDisparity(cv::Mat&, const
> > cv::Mat&, int, int, int)
> > /usr/local/include/opencv2/calib3d/calib3d.hpp:718: error: after
> > previous specification in void cv::validateDisparity(cv::Mat&, const
> > cv::Mat&, int, int, int)
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:955: error: default argument
> > given for parameter 4 of void cv::reprojectImageTo3D(const cv::Mat&,
> > cv::Mat&, const cv::Mat&, bool)
> > /usr/local/include/opencv2/calib3d/calib3d.hpp:723: error: after
> > previous specification in void cv::reprojectImageTo3D(const cv::Mat&,
> > cv::Mat&, const cv::Mat&, bool)
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:957: error: redefinition of
> > class cv::KeyPoint
> > /usr/local/include/opencv2/features2d/features2d.hpp:209: error:
> > previous definition of class cv::KeyPoint
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:981: error: redefinition of
> > class cv::SURF
> > /usr/local/include/opencv2/features2d/features2d.hpp:332: error:
> > previous definition of class cv::SURF
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:998: error: redefinition of
> > class cv::MSER
> > /usr/local/include/opencv2/features2d/features2d.hpp:362: error:
> > previous definition of class cv::MSER
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:1010: error: redefinition of
> > class cv::StarDetector
> > /usr/local/include/opencv2/features2d/features2d.hpp:381: error:
> > previous definition of class cv::StarDetector
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:1026: error: redefinition of
> > class CvLevMarq
> > /usr/local/include/opencv2/calib3d/calib3d.hpp:390: error: previous
> > definition of class CvLevMarq
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:1065: error: redefinition of
> > struct lsh_hash
> > /usr/local/include/opencv2/imgproc/imgproc.hpp:839: error: previous
> > definition of struct lsh_hash
> > pyopencv/pyopencvext/sdopencv/sdcv.hpp:1069: error: redefinition of
> > struct CvLSHOperations
> > /usr/local/include/opencv2/imgproc/imgproc.hpp:844: error: previous
> > definition of struct CvLSHOperations
>
> >     "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -
> > Wall -O3 -fPIC -Wno-strict-aliasing -I/usr/local/include/opencv -I/
> > home/joost/OpenCV/boost_1_43_0 -Ipyopencv -Ipyopencv/pyopencvext -
> > Ipyopencv/pyopencvext/numpy_include -Ipyopencv/pyopencvext/core -
> > Ipyopencv/pyopencvext/sdopencv  -DBOOST_PYTHON_STATIC_LIB -DNDEBUG  -
> > I"/home/joost/OpenCV/boost_1_43_0" -I"/usr/include/python2.6" -c -o
> > "bin/gcc-4.4.3/release/link-static/pyopencv/pyopencvext/
> > pyopencvext_free_functions_gete.pypp.o" "pyopencv/pyopencvext/
> > pyopencvext_free_functions_gete.pypp.cpp"
>
> > ...failed gcc.compile.c++ bin/gcc-4.4.3/release/link-static/pyopencv/
> > pyopencvext/pyopencvext_free_functions_gete.pypp.o...
>
> --
> Dr. Minh-Tri Pham
> Research Fellow, University of Surrey, UK
> Email: t.p...@surrey.ac.uk or pmtr...@gmail.com

Rekveld

unread,
Jul 19, 2010, 4:35:22 AM7/19/10
to ctypes-opencv
Hi Minh-Tri,

strange, I'm trying again now with the same sources described above
and 'sudo python setup.py build' and now pyopencv seems to compile
correctly, which is great !
thanks,

Joost.

Rekveld

unread,
Jul 19, 2010, 4:44:38 AM7/19/10
to ctypes-opencv
One important thing I tried and probably makes the difference is that
I disabled the option BUILD_NEW_PYTHON_SUPPORT.

ciao,

Joost.

Minh-Tri Pham

unread,
Jul 19, 2010, 5:22:08 AM7/19/10
to ctypes...@googlegroups.com
Glad you have resolved the problem. I will take note of your experience in
the future FAQ list.

Cheers,
Minh-Tri

>>> �class cv::SURF�
>>> /usr/local/include/opencv2/features2d/features2d.hpp:332: error:
>>> previous definition of �class cv::SURF�


>>> pyopencv/pyopencvext/sdopencv/sdcv.hpp:998: error: redefinition of

>>> �class cv::MSER�
>>> /usr/local/include/opencv2/features2d/features2d.hpp:362: error:
>>> previous definition of �class cv::MSER�


>>> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1010: error: redefinition of

>>> �class cv::StarDetector�
>>> /usr/local/include/opencv2/features2d/features2d.hpp:381: error:
>>> previous definition of �class cv::StarDetector�


>>> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1026: error: redefinition of

>>> �class CvLevMarq�
>>> /usr/local/include/opencv2/calib3d/calib3d.hpp:390: error: previous
>>> definition of �class CvLevMarq�


>>> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1065: error: redefinition of

>>> �struct lsh_hash�
>>> /usr/local/include/opencv2/imgproc/imgproc.hpp:839: error: previous
>>> definition of �struct lsh_hash�


>>> pyopencv/pyopencvext/sdopencv/sdcv.hpp:1069: error: redefinition of

>>> �struct CvLSHOperations�
>>> /usr/local/include/opencv2/imgproc/imgproc.hpp:844: error: previous
>>> definition of �struct CvLSHOperations�

Email: t.p...@surrey.ac.uk or pmt...@gmail.com

Reply all
Reply to author
Forward
0 new messages