Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building OpenCV 2.4.8 with VS2015 as x86

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!

Building OpenCV 2.4.8 3.2.0 with VS2015 as x86

I have code written many years ago (displayvideoqt) 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!

Building OpenCV 3.2.0 with VS2015 as x86

I have code written many years ago (displayvideoqt) 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!