What am I doing wrong?

I try to build my first OpenCV app and here what I get:

1>error LNK2019: unresolved external symbol “public: void __cdecl cv::dnn::dnn4_v20230620::Net::forward(class cv::debug_build_guard::_OutputArray const &,class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > > const &)”

1>error LNK2019: unresolved external symbol “public: void __cdecl cv::dnn::dnn4_v20230620::Net::setInput(class cv::debug_build_guard::InputArray const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,double,class cv::Scalar const &)”

1>error LNK2019: unresolved external symbol “class cv::Mat _cdecl cv::dnn::dnn4_v20230620::blobFromImage(class cv::debug_build_guard::InputArray const &,double,class cv::Size const &,class cv::Scalar const &,bool,bool,int)”

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 &)”

1>error LNK2019: unresolved external symbol “void cdecl cv::rectangle(class cv::debug_build_guard::InputOutputArray const &,class cv::Point,class cv::Point,class cv::Scalar const &,int,int,int)”

1>error LNK2019: unresolved external symbol “void _cdecl cv::rectangle(class cv::debug_build_guard::InputOutputArray const &,class cv::Rect,class cv::Scalar const &,int,int,int)”

1>error LNK2019: unresolved external symbol “void _cdecl cv::putText(class cv::debug_build_guard::InputOutputArray const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class cv::Point,int,double,class cv::Scalar,int,int,bool)”

What library should I add to have these names resolved?

Environment: VisualStudio 2022 C++; OpenCV obtained via VCPKG.

Sorry, found solution myself. Had to use “C:\VCPKG\installed\x64-windows\debug\lib” instead of “C:\VCPKG\installed\x64-windows\lib”.

1 Like

use “C:\VCPKG\installed\x64-windows\debug\lib"

1 Like