Opencv_calib3d310.lib occurred error and solved

Hi all

I just want to make depth mask from StereoBM with ofxOpenCv and ofxCv. At the time, I had two errors.

First, I found sample like below.

cv::StereoBM sbm; //stereo block matching
sbm(imgMatL, imgMatR, stereoMat); // Calculate the diaparity and save into stereoMat

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E0322	object of abstract class type "cv::StereoBM" is not allowed:	depth	c:\of_v0.10.0_vs2017_release\apps\test\depth\src\ofApp.cpp	19	

I fixed it like below

cv::Ptr<cv::StereoBM> sbm = cv::StereoBM::create();
sbm->compute(imgMatL, imgMatR, stereoMat);

Second, there was link error with opencv_calib3d310d.lib

Error	LNK2019	unresolved external symbol ___std_reverse_trivially_swappable_4 referenced in function "void __cdecl std::_Reverse_unchecked1<unsigned int *>(unsigned int * const,unsigned int * const,struct std::integral_constant<unsigned int,4>)" (??$_Reverse_unchecked1@PAI@std@@YAXQAI0U?$integral_constant@I$03@0@@Z)	depth	C:\of_v0.10.0_vs2017_release\apps\test\depth\opencv_calib3d310d.lib(circlesgrid.obj)	1	

I checked Linker Input and it looks like alright. So, I download OpenCV build from OpenCv site and change lib to opencv_world310d.lib. Althought it need opencv_world310d.dll, works fine.

I’m not sure what is problem. Anyway I just report it.