An error occurred using opencv SLIC c++

the original source:

I’m using VisualStudio17, 19

the error message is:

|error|LNK2019|struct cv::Ptr __cdecl cv::ximgproc::createSuperpixelSLIC(class cv::debug_build_guard::_InputArray const &,int,int,float) (?createSuperpixelSLIC@ximgproc@cv@@YA?AU?$Ptr@VSuperpixelSLIC@ximgproc@cv@@@2@AEBV_InputArray@debug_build_guard@2@HHM@Z)main Unverifiable external symbols referenced by the function |SLIC|C:\Users\Taeyeong\source\repos\SLIC\SLIC\main.obj|1||

I downloaded contrib files on:


moved the folder and file “ximgproc, ximgproc.hpp”
in folder “opencv_contrib_master/modules/ximgproc/include/opencv2”


(the opencv folder that I use)

why the error occurred?

should I make the project file with “cmake”?
(I made project file directly using VisualStudio and set project debug properties to include opencv)

you have to link DEBUG libs (those ending with d), not RELEASE libs.
please check