I have code written many years ago for Win32 that I want to add opencv functions to. I did all the include, linker, and library options in VS2015, compiled from scratch using CMake, etc and no matter what I try to tweak I always get the following error just from trying to use cv::Mat (#include <opencv2\core\core.hpp>
displayvideoqt.obj : error LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd@cv@@YAHPAHH@Z) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ)
I have found that in cv::Mat::release() CVX_ADD is defined as this cv::_interlockedExchangeAdd(int *, int) in core/system.hpp. It appears that the function is actually defined in core/operations.hpp but that the definition is not being linked to despite the fact that I have the opencv_core320d.lib in my linker.
I am using CMake, VS2015, and on Windows 10.
Any help would be much appreciated!