Errors while Compiling in Visual C++ 2008, after installation of MS Platform SDK

前端 未结 2 1895
感动是毒
感动是毒 2021-01-22 10:09

I was using OpenCV and after I installed Microsoft Platform SDK to work with OpenGL these errors are showing up when trying to compile my opencv project.

1>d:         


        
相关标签:
2条回答
  • 2021-01-22 10:27

    Resolution: http://stefanobolli.blogspot.com/2010/10/compiler-error-c2733-second-c-linkage.html

    0 讨论(0)
  • 2021-01-22 10:32

    This solution solved my issue.

    Take note that you must ensure that intrin.h does not get accidentally included (e.g. by some other header file you use) before this fix below.

    #if _MSC_VER >= 1400
    //  Following 8 lines: workaround for a bug in some older SDKs
    #   pragma push_macro("_interlockedbittestandset")
    #   pragma push_macro("_interlockedbittestandreset")
    #   pragma push_macro("_interlockedbittestandset64")
    #   pragma push_macro("_interlockedbittestandreset64")
    #   define _interlockedbittestandset _local_interlockedbittestandset
    #   define _interlockedbittestandreset _local_interlockedbittestandreset
    #   define _interlockedbittestandset64 _local_interlockedbittestandset64
    #   define _interlockedbittestandreset64 _local_interlockedbittestandreset64
    #   include <intrin.h> // to force the header not to be included elsewhere
    #   pragma pop_macro("_interlockedbittestandreset64")
    #   pragma pop_macro("_interlockedbittestandset64")
    #   pragma pop_macro("_interlockedbittestandreset")
    #   pragma pop_macro("_interlockedbittestandset")
    #endif
    
    0 讨论(0)
提交回复
热议问题