I tried to use a MATLAB coder compiled C++ library in vs 2017 but encountered the error below:
1>test_cv_2.lib(test_cv_2.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>test_cv_2.lib(test_cv_2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library [1]
From my initial search in the web and i have look through this post: error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
I think the configuration may need to be setup from MATLAB coder as well:
And there is another configuration in vs 2017
Anyone have any idea on the correct settings based on the images above? Or is there any extra settings need to be done?
I have tried out several settings but the same error occur, for example, set Build configuration set to debug in MATLAB coder environment and Multi-threaded Debug DLL (/MDd) in vs 2017 setting.
Thank you.