Author Topic: Build error w Code Blocks using Opencv 2.1, Windows XP, Mingw 5.1.6, cmake 2.8  (Read 10203 times)

lev07

  • Guest
Greetings ppl!

I have a problem building the created projected file with cmake 2.8 from Opencv 2.1 source in Code Blocks on Windows XP. The error message that I receive is around at the 42% of the building process. Sorry because I am very noob to all of this building, compiling etc. thing.
Could You post some solution idea? What could the problem be?!

Here is the building log that i receive:


C:/OpenCV-2.1.0/include/opencv/cxcore.hpp: In instantiation of `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]':
C:\OpenCV-2.1.0\src\cxcore\cxdrawing.cpp:959:   instantiated from here
C:/OpenCV-2.1.0/include/opencv/cxcore.hpp:304: error: new declaration `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]'
C:/OpenCV-2.1.0/include/opencv/cxcore.hpp:304: error: ambiguates old declaration `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]'
C:/OpenCV-2.1.0/include/opencv/cxcore.hpp: In instantiation of `cv::Vec<int, cn>':
C:/OpenCV-2.1.0/include/opencv/cxoperations.hpp:598:   instantiated from `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]'
C:\OpenCV-2.1.0\src\cxcore\cxdrawing.cpp:959:   instantiated from here
C:/OpenCV-2.1.0/include/opencv/cxcore.hpp:243: error: size of array is not an integral constant-expression
C:/OpenCV-2.1.0/include/opencv/cxoperations.hpp: In member function `cv::Vec<_Tp, cn>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]':
C:\OpenCV-2.1.0\src\cxcore\cxdrawing.cpp:959:   instantiated from here
C:/OpenCV-2.1.0/include/opencv/cxoperations.hpp:598: error: invalid initialization of reference of type 'cv::Vec<int, cn>&' from expression of type 'cv::Point_<int>'
mingw32-make.exe[2]: *** [src/cxcore/CMakeFiles/cxcore.dir/cxdrawing.obj] Error 1
mingw32-make.exe[2]: Leaving directory `C:/OpenCV-2.1.0/release'
mingw32-make.exe[1]: *** [src/cxcore/CMakeFiles/cxcore.dir/all] Error 2
mingw32-make.exe[1]: Leaving directory `C:/OpenCV-2.1.0/release'
mingw32-make.exe: *** [all] Error 2
Process terminated with status 2 (0 minutes, 17 seconds)
4 errors, 0 warnings


Thank You very much!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Turn on Full Compiler Logging and post the result somewhere else;
Post in a group that supports the library and the Compiler.
This websites DOES NOT support the library or the Compiler you are using!

How to "Turn on Full Compiler Logging"
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Please read http://forums.codeblocks.org/index.php/topic,9996.0.html

Edit: if you have an question about where to put an Compiler or Linker Option inside Code::Blocks then this is the correct website to ask that question.

Tim S.
« Last Edit: May 04, 2010, 06:07:41 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I have see a same thread in Chinese OpenCV forum.
If you understand Chinese language, see: (or you can use Google translate)
codeblocks opencv2.1 compile error, but the user upgrade his GCC compiler, and the problem is gone.

Maybe, this can solve your problem too.

BTW: I have successfully build OpenCV 2.1 library with Loaden's GCC 4.4.3.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.