Build error with OpenNI in VS2010

asked 2013-09-11 10:38:04 -0600

Jon gravatar image

Hi, I've been trying to build OpenCV from source with VS2010 as a learning exercise by following the tutorial available in the documentation. Since I'll be using OpenCV with a Kinect, I also included OpenNI 1.5. All the OpenCV modules seem to compile fine, except for highgui, which produces the following errors during compilation:

------ Build started: Project: opencv_highgui, Configuration: Debug Win32 ------
  cap_openni.cpp
..\..\..\modules\highgui\src\cap_openni.cpp(421): warning C4512: 'ApproximateSyncGrabber' : assignment operator could not be generated
          ..\..\..\modules\highgui\src\cap_openni.cpp(99) : see declaration of 'ApproximateSyncGrabber'
..\..\..\modules\highgui\src\cap_openni.cpp(217): warning C4127: conditional expression is constant
..\..\..\modules\highgui\src\cap_openni.cpp(273): error C2440: 'initializing' : cannot convert from 'xn::DepthMetaData *' to 'cv::Ptr<T>'
          with
          [
              T=xn::DepthMetaData
          ]
          Constructor for struct 'cv::Ptr<T>' is declared 'explicit'
          with
          [
              T=xn::DepthMetaData
          ]
..\..\..\modules\highgui\src\cap_openni.cpp(279): error C2440: 'initializing' : cannot convert from 'xn::ImageMetaData *' to 'cv::Ptr<T>'
          with
          [
              T=xn::ImageMetaData
          ]
          Constructor for struct 'cv::Ptr<T>' is declared 'explicit'
          with
          [
              T=xn::ImageMetaData
          ]
..\..\..\modules\highgui\src\cap_openni.cpp(332): error C2440: 'initializing' : cannot convert from 'xn::DepthMetaData *' to 'cv::Ptr<T>'
          with
          [
              T=xn::DepthMetaData
          ]
          Constructor for struct 'cv::Ptr<T>' is declared 'explicit'
          with
          [
              T=xn::DepthMetaData
          ]
..\..\..\modules\highgui\src\cap_openni.cpp(350): error C2440: 'initializing' : cannot convert from 'xn::ImageMetaData *' to 'cv::Ptr<T>'
          with
          [
              T=xn::ImageMetaData
          ]
          Constructor for struct 'cv::Ptr<T>' is declared 'explicit'
          with
          [
              T=xn::ImageMetaData
          ]
..\..\..\modules\highgui\src\cap_openni.cpp(875): error C2679: binary '=' : no operator found which takes a right-hand operand of type 'ApproximateSyncGrabber *' (or there is no acceptable conversion)
          C:\OpenCV\modules\core\include\opencv2/core/cvstd.hpp(242): could be 'cv::Ptr<T> &cv::Ptr<T>::operator =(const cv::Ptr<T> &)'
          with
          [
              T=ApproximateSyncGrabber
          ]
          while trying to match the argument list '(cv::Ptr<T>, ApproximateSyncGrabber *)'
          with
          [
              T=ApproximateSyncGrabber
          ]
..\..\..\modules\highgui\src\cap_openni.cpp(954): warning C4244: '=' : conversion from 'XnUInt64' to 'double', possible loss of data
..\..\..\modules\highgui\src\cap_openni.cpp(1042): warning C4244: '=' : conversion from 'XnUInt64' to 'double', possible loss of data
..\..\..\modules\highgui\src\cap_openni.cpp(1178): error C2440: 'initializing' : cannot convert from 'XnPoint3D *' to 'cv::Ptr<T>'
          with
          [
              T=XnPoint3D
          ]
          Constructor for struct 'cv::Ptr<T>' is declared 'explicit'
          with
          [
              T=XnPoint3D
          ]
..\..\..\modules\highgui\src\cap_openni.cpp(1179): error C2440: 'initializing' : cannot convert from 'XnPoint3D *' to 'cv::Ptr<T>'
          with
          [
              T=XnPoint3D
          ]
          Constructor for struct 'cv::Ptr<T>' is declared 'explicit'
          with
          [
              T=XnPoint3D
          ]

Can anyone point me towards the right direction to solve this issue?

edit retag flag offensive close merge delete