簡體   English   中英

將Visual C ++項目遷移到Visual Studio 2013-DirectShow基類錯誤C2169

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM