Hello, I have been following a tutorial on how to install opencv from:
I have done everything exactly like the video and I reach up to building with cmake, the problem is that there are errors while building.
my system info is:
Windows 11
Cmake(using UI) 3.27.23
Opencv 4.8.0 windows exe
g++ (MinGW-W64 x86_64-ucrt-mcf-seh, built by Brecht Sanders) 13.2.0
python 3.10.7
C:\ opencv\opencv\build>mingw32-make
[ 0%] Built target opencv_dnn_plugins
[ 0%] Built target opencv_highgui_plugins
[ 2%] Built target jsimd
[ 4%] Built target libopenjp2
[ 4%] Built target opencv_videoio_plugins
[ 5%] Built target zlib
[ 11%] Built target opencv_core
[ 16%] Built target opencv_imgproc
[ 18%] Built target libjpeg-turbo
[ 21%] Built target libtiff
[ 27%] Built target libwebp
[ 28%] Built target libpng
[ 34%] Built target IlmImf
[ 36%] Built target opencv_imgcodecs
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_obsensor/obsensor_uvc_stream_channel.cpp.obj
In file included from C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:41,
from C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_uvc_stream_channel.cpp:33:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:145:42: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
106 | _COM_SMARTPTR_TYPEDEF(T, __uuidof(T));
| ^
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:146:44: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:148:45: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:149:47: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:150:45: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:151:49: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:152:40: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of ‘class cv::obsensor::ComPtr’:
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:153:39: required from here
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument ‘cv::obsensor::ComPtr::__T_IID_getter’ from ‘const IID& (cv::obsensor::ComPtr::)()’ {aka ‘const GUID& (cv::obsensor::ComPtr::)()’} to ‘const IID& ()()’ {aka 'const GUID& ()()’}
C:\ opencv\opencv\sources\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:129:7: warning: base class ‘struct IMFSourceReaderCallback’ has accessible non-virtual destructor [-Wnon-virtual-dtor]
129 | class MSMFStreamChannel : public IUvcStreamChannel, public IMFSourceReaderCallback
| ^~~~~~~~~~~~~~~~~
mingw32-make[2]: *** [modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:241: modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_obsensor/obsensor_uvc_stream_channel.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2598: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
mingw32-make: *** [makefile:165: all] Error 2