Long story short, I included OpenCV version 2.3.1 (currently the latest) in my modified ARDrone Win32 Client version 1.5 (currently not the latest) and have been struggling ever since to marry the two. I'm using Microsoft Visual Studio 2008 (full version).
To start off, the file I am working with the most in the Win32 Client is "video_stage.c"; I'm working with video manipulation, etc., hence the OpenCV. In order to gain the full functionality 开发者_如何学运维of OpenCV within video_stage.c, I need to change video_stage.c to a C++ file (correct me if I'm wrong on that).
So I've done the necessary code-altering to make video_stage.c compile as a C++ file. However, I'm still running into an error that I can't quite wrap my head around:
...\include\opencv2\core\mat.hpp(115) : error C3861: '_InterlockedExchangeAdd': identifier not found
This error occurs several more times, at lines 305, 377, 381, 2064, 2092, and 2096.
EDIT: It has been pointed out that "_InterlockedExchangeAdd" is used in operations.hhp:
#define CV_XADD(addr,delta) _InterlockedExchangeAdd((long volatile*)(addr), (delta))
CV_XADD is referenced many times in mat.hpp, causing the long list of errors. What is the problem with this piece of code?
As it turns out, ARDrone included its own copy of "intrin.h", the header file that contains _InterlockedExchangeAdd normally. For some reason unknown to me, Microsoft Visual C++ prioritized this new copy over the original, and for some reason again unknown to me, ARDrone's version does not contain _InterlockedExchangeAdd or any of the similar functions.
精彩评论