Errors during compiling tutorial (feature_homography)
Hi,
I have issues while compiling this tutorial code: tutorial_feature_homography
I'm using OpenCV 3.3.1 and Visual Studio 2017 (Windows 7 platform).
Compiler output:
How can I solve it?
Regards!
UPDATE1:
I have added opencv_flann331d.lib to Linker - Input - Additional Dependencies and its solved issues with cv::flann.
UPDATE2:
I have added opencv_features2d331d.lib (I missed that there are 2 similar libs opencv_features2d331d.lib and opencv_xfeatures2d331d.lib) to Linker - Input - Additional Dependencies and its solved some more issues.
My current list of libs in Linker:
- opencv_core331d.lib
- opencv_highgui331d.lib
- opencv_imgproc331d.lib
- opencv_imgcodecs331d.lib
- opencv_video331d.lib
- opencv_videoio331d.lib
- opencv_features2d331d.lib
- opencv_xfeatures2d331d.lib
- opencv_line_descriptor331d.lib
- opencv_flann331d.lib
Now build log looks like this:
main.cpp d:\projects\video_recognition\videorecog\img_template_match01\img_template_match01\main.cpp(76): warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data
d:\projects\video_recognition\videorecog\img_template_match01\img_template_match01\main.cpp(77): warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data
d:\projects\video_recognition\videorecog\img_template_match01\img_template_match01\main.cpp(78): warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data
d:\projects\video_recognition\videorecog\img_template_match01\img_template_match01\main.cpp(79): warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data
main.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::findHomography(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,int,double,class cv::debug_build_guard::_OutputArray const &,int,double)" (?findHomography@cv@@YA?AVMat@1@ABV_InputArray@debug_build_guard@1@0HNABV_OutputArray@41@HN@Z) referenced in function _main
D:\Projects\video_recognition\VideoRecog\img_template_match01\Debug\img_template_match01.exe : fatal error LNK1120: 1 unresolved externals
be kind to this site, and replace your screenshots with proper text version, thank you !
From your error log, it suggests a linker error especially with locating
cv::flann
. Confirm that opencv was built with opencv_contrib and the modules were probably linkedHi, @berak, ok, I have replaced screen with text.
@eshirima How can I confirm what opencv biulded with contrib modules (i'm sure 99% that it have been built with them)?
Here is CMake config screen: screen
I have added opencv_flann331d.lib to Linker - Input - Additional Dependencies and its solver cv::flann issues. Also I tried to search some .lib files for cv::DescriptorMatcher , but looks like I'm going wrong way. Please, advice what else can I do? I suppose its all about linker settings...
Now, build log looks like this:
log at pastebin
opencv_features2d opencv_calib3d opencv_flann opencv_xfeatures2d
if you did not build the opencv libs with opencv_contrib, you won't have xfeatures2d, in thatcase rather try this tutorial
Ok, have solve some others issues (see UPDATE2), there are couple more left.