![](/img/trans.png)
[英]Error : MFC requires use of Winsock2.h after migrating Visual C++ project to Visual Studio 2013
[英]Migrating Visual C++ project to Visual Studio 2013 - DirectShow baseclasses error C2169
我已将Visual C ++项目迁移到Visual Studio2013。当我尝试构建项目时,编译器返回以下错误:
Error 2 error C2169: '_InterlockedIncrement' : intrinsic function, cannot be defined
错误在combase.h(DirectShow的标头)中,代码为:
static inline LONG WINAPI InterlockedIncrement(volatile LONG * plong) { return InterlockedIncrement( const_cast<LONG*>( plong ) ); }
在winnt.h中将InterlockedIncrement定义为:
#define InterlockedIncrement _InterlockedIncrement
您知道此错误的任何解决方案吗?
您的#define
用_InterlockedIncrement
替换了所有出现的InterlockedIncrement
,因此static inline LONG WINAPI InterlockedIncrement(volatile LONG * plong)
变为static inline LONG WINAPI _InterlockedIncrement(volatile LONG * plong)
。
这意味着您实际上正在尝试定义_InterlockedIncrement
函数,该函数是_InterlockedIncrement
函数,因此被禁止。
我认为您需要删除
#define InterlockedIncrement _InterlockedIncrement
并根据需要使用适当的参数转换使InterlockedIncrement
调用_InterlockedIncrement
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.