Bonjour

J'essaye de compiler OpenCV 1.2 sous Windows XP à partir des sources.

Pour cela, j'ai sur mon PC :
MSYS 1.0 ( http://www.mingw.org/wiki/msys)
MingW 5.1.4 ( http://www.mingw.org/ )
CMake 2.6 ( http://www.cmake.org )

J'ai suivi la procédure :
- decompresser le source
- créer un répertoire
- lancer cmake-gui, configurer et générer les fichiers makefile
- lancer mingw32-make

Et la j'ai une erreur C++ qui apparait :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[ 42%] Building CXX object src/cxcore/CMakeFiles/cxcore.dir/cxcopy.obj
[ 42%] Building CXX object src/cxcore/CMakeFiles/cxcore.dir/cxdatastructs.obj
[ 42%] Building CXX object src/cxcore/CMakeFiles/cxcore.dir/cxdrawing.obj
C:/xxx/OpenCV-1.2.0/include/opencv/cxcore.hpp: In instantiation of `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]':
C:\xxx\OpenCV-1.2.0\src\cxcore\cxdrawing.cpp:954:   instantiated from here
C:/xxx/OpenCV-1.2.0/include/opencv/cxcore.hpp:289: error: new declaration `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]'
C:/xxx/OpenCV-1.2.0/include/opencv/cxcore.hpp:289: error: ambiguates old declaration `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]'
C:/xxx/OpenCV-1.2.0/include/opencv/cxcore.hpp: In instantiation of `cv::Vec<int, cn>':
C:/xxx/OpenCV-1.2.0/include/opencv/cxoperations.hpp:589:   instantiated from `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]'
C:\xxx\OpenCV-1.2.0\src\cxcore\cxdrawing.cpp:954:   instantiated from here
C:/xxx/OpenCV-1.2.0/include/opencv/cxcore.hpp:232: error: size of array is not an integral constant-expression
C:/xxx/OpenCV-1.2.0/include/opencv/cxoperations.hpp: In member function `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]':
C:\xxx\OpenCV-1.2.0\src\cxcore\cxdrawing.cpp:954:   instantiated from here
C:/xxx/OpenCV-1.2.0/include/opencv/cxoperations.hpp:589: error: invalid initialization of reference of type 'cv::Vec<int, cn>&' from expression of type 'cv::Point_<int>'
mingw32-make[2]: *** [src/cxcore/CMakeFiles/cxcore.dir/cxdrawing.obj] Error 1
mingw32-make[1]: *** [src/cxcore/CMakeFiles/cxcore.dir/all] Error 2
mingw32-make: *** [all] Error 2
Est-ce que quelqu'un peu m'aider ?

Voici la ligne incriminée dans cxoperations.hpp :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
template<typename _Tp> inline Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
{ x = pt.x; y = pt.y; return *this; }
Cordialement
Emmanuel