I am new in c++ but i need to do a project using opencv. I have downlaoded opencv-4.5.2 and opencv_contrib and I am using Visual 2019. I have used cmake and I got no error.
Then in the project I have included, the "C:\opencv\opencv_lib\install\include" directory fot the C++ additional include directories For the Linker I have included ,"C:\opencv\opencv_lib\install\x64\vc16\lib" for the additional library directories. I have included, "opencv_core452.lib,opencv_highgui452.lib,opencv_imgcodecs452.lib", int he additional dependacies. I have included, "C:...opencv\build\x64\vc14\bin" for the path.
When i run a simple project it seems that something goes wrong and I am not sure what it is. Here are the errors:
Severity Code Description Project File Line Suppression State
- Error LNK2019 unresolved external symbol "public: class cv::Mat & __thiscall cv::Mat::operator=(class cv::Mat &&)" (??4Mat@cv@@QAEAAV01@$$QAV01@@Z) referenced in function _main protorype C:...\protorype.obj 1
- Error LNK2019 unresolved external symbol "public: __thiscall cv::Mat::Mat(void)" (??0Mat@cv@@QAE@XZ) referenced in function _main protorype C:...\protorype.obj 1
- Error LNK2019 unresolved external symbol "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) referenced in function _main protorype C:...\protorype.obj 1
- Error LNK2019 unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int)" (?imread@cv@@YA?AVMat@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function _main protorype C:...\protorype.obj 1
- Error LNK2019 unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int)" (?namedWindow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function _main protorype C:...\protorype.obj 1
- Error LNK2019 unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class cv::debug_build_guard::_InputArray const &)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@debug_build_guard@1@@Z) referenced in function _main protorype C:...\protorype.obj 1
- Error LNK1120 6 unresolved externals protorype C:...\protorype.exe 1
Because I am new, please explain me in simple words hwo to resolve it. Thank you in advance!
opencv_core452.lib
looks correct but make sure you specify it in the right place. this looks like that didn't work. – Christoph Rackwitz