Hello @ cudawarped
Thank you for the answer.
As far as I understand, to get python bindings, C++ debug files and C++ release files in the same built before running cmake command we make the changes stated here to source files. Can you confirm?
For BUILD_SHARED_LIBS=OFF errors, even if I add the bin directory to Path environment variable I still get errors. In Visual studio. Should we change Properties->C/C+±>Code generation->Runtime Library? For Debug its default value is Multi-threaded Debug DLL (/MD) and for release its default value is Multi-threaded DLL (/MD).
Here are some of the errors I get from Visual Studio. The code works without errors with builts BUILD_SHARED_LIBS=ON.
1>Generating Code...
1>opencv_world480d.lib(matrix.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in Config.obj
1>opencv_world480d.lib(matrix.obj) : warning LNK4099: PDB 'opencv_world480d.pdb' was not found with 'opencv_world480d.lib(matrix.obj)' or at 'C:\Users\THEUSER\Desktop\01_vsprojects\Trackers\OpenCVTrackers_00\x64\Debug\opencv_world480d.pdb'; linking object as if no debug info
1>opencv_world480d.lib(convert.dispatch.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in Config.obj
1>opencv_world480d.lib(convert.dispatch.obj) : warning LNK4099: PDB 'opencv_world480d.pdb' was not found with 'opencv_world480d.lib(convert.dispatch.obj)' or at 'C:\Users\THEUSER\Desktop\01_vsprojects\Trackers\OpenCVTrackers_00\x64\Debug\opencv_world480d.pdb'; linking object as if no debug info
1>opencv_world480d.lib(loadsave.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in Config.obj
...
...
...
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_domain_createA_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_id_create_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_id_destroy_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_string_handle_createA_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_region_begin_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_region_end_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_task_begin_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_task_end_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_metadata_add_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_metadata_str_addA_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_relation_add_ptr__3_0
1>opencv_world480d.lib(trace.obj) : error LNK2001: unresolved external symbol __itt_api_version_ptr__3_0
...
...
...
1>opencv_world480d.lib(templmatch.obj) : error LNK2019: unresolved external symbol ippicviCrossCorrNorm_32f_C1R referenced in function "bool __cdecl cv::ipp_crossCorr(class cv::Mat const &,class cv::Mat const &,class cv::Mat &,bool)" (?ipp_crossCorr@cv@@YA_NAEBVMat@1@0AEAV21@_N@Z)
1>opencv_world480d.lib(templmatch.obj) : error LNK2019: unresolved external symbol ippicviCrossCorrNorm_8u32f_C1R referenced in function "bool __cdecl cv::ipp_crossCorr(class cv::Mat const &,class cv::Mat const &,class cv::Mat &,bool)" (?ipp_crossCorr@cv@@YA_NAEBVMat@1@0AEAV21@_N@Z)
1>opencv_world480d.lib(templmatch.obj) : error LNK2019: unresolved external symbol ippicviSqrDistanceNormGetBufferSize referenced in function "bool __cdecl cv::ipp_sqrDistance(class cv::Mat const &,class cv::Mat const &,class cv::Mat &)" (?ipp_sqrDistance@cv@@YA_NAEBVMat@1@0AEAV21@@Z)
1>opencv_world480d.lib(templmatch.obj) : error LNK2019: unresolved external symbol ippicviSqrDistanceNorm_32f_C1R referenced in function "bool __cdecl cv::ipp_sqrDistance(class cv::Mat const &,class cv::Mat const &,class cv::Mat &)" (?ipp_sqrDistance@cv@@YA_NAEBVMat@1@0AEAV21@@Z)
1>opencv_world480d.lib(templmatch.obj) : error LNK2019: unresolved external symbol ippicviSqrDistanceNorm_8u32f_C1R referenced in function "bool __cdecl cv::ipp_sqrDistance(class cv::Mat const &,class cv::Mat const &,class cv::Mat &)" (?ipp_sqrDistance@cv@@YA_NAEBVMat@1@0AEAV21@@Z)
1>opencv_world480d.lib(init.obj) : error LNK2019: unresolved external symbol "void __cdecl google::protobuf::ShutdownProtobufLibrary(void)" (?ShutdownProtobufLibrary@protobuf@google@@YAXXZ) referenced in function "public: __cdecl cv::dnn::dnn4_v20230620::`anonymous namespace'::ProtobufShutdown::~ProtobufShutdown(void)" (??1ProtobufShutdown@?A0x8580819d@dnn4_v20230620@dnn@cv@@QEAA@XZ)
1>opencv_world480d.lib(pooling_layer.cpp.obj) : error LNK2019: unresolved external symbol __std_max_element_1 referenced in function "signed char const * __cdecl __std_max_element<signed char const >(signed char const *,signed char const *)" (??$__std_max_element@$$CBC@@YAPEBCPEBC0@Z)
1>opencv_world480d.lib(permute_layer.obj) : error LNK2019: unresolved external symbol __std_find_trivial_8 referenced in function "unsigned __int64 * __cdecl __std_find_trivial<unsigned __int64,int>(unsigned __int64 *,unsigned __int64 *,int)" (??$__std_find_trivial@_KH@@YAPEA_KPEA_K0H@Z)
1>C:\Users\THEUSER\Desktop\01_vsprojects\Trackers\OpenCVTrackers_00\x64\Debug\OpenCVTrackers_00.exe : fatal error LNK1120: 675 unresolved externals
1>Done building project "OpenCVTrackers_00.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========