VS2022 配置OpenCV报错

1、 Error LNK2019 unresolved external symbol __imp__invalid_parameter referenced in function “void * __cdecl std::_Allocate_manually_vector_aligned(unsigned__int64)”(??KaTeX parse error: Expected group after '_' at position 129: …xternal symbol _̲_imp__calloc_db…_Maklocstr@D@std@@YAPEADPEBDPEADAEBU_Cvtvec@@@Z)
3、 Error LNK2019 unresolved external symbol __imp__CrtDbgReport referenced in function “void * __cdecl std::_Allocate_manually_vector_aligned(unsigned __int64)” (??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z)
4、 Error LNK2019 unresolved external symbol WinMain referenced in function “int __cdecl __scrt_common_main_seh(void)” (?__scrt_common_main_seh@@YAHXZ)
5、 Error LNK11204 unresolved externals

1、配置环境是X64还是X86,这个坑还是会跳进去的,一定要注意,之前配置的是X86,重装系统后或者换成X64,但是用的配置是X86;
2、报找不到.lib或.dll,将这两个路径的.lib和.dll文件C:\Program Files\OpenCV.4.3.0\opencv\build\lib\Debug和C:\Program Files\OpenCV.4.3.0\opencv\build\bin\Debug分别拷贝至C:\Program Files\OpenCV.4.3.0\opencv\build\x64\vc15\lib和C:\Program Files\OpenCV.4.3.0\opencv\build\x64\vc15\bin;

你可能感兴趣的:(OpenCV,Link2019)