最新版Duilib在VS2012下編譯錯誤的解決方法


        svn了好幾次最新版本的項目源代碼, 在VS2012下編譯老是出錯, 改了后沒記錄, 結果又忘記, 所以在此記錄下.

       這個問題很普遍, 非常多的人遇到.

      至於其它的示例Demo的錯誤則簡單修改項目屬性即可.

 

       好了,錯誤描述就像下面這樣:

1>------ Build started: Project: DuiLib, Configuration: UnicodeDebug Win32 ------
1>  StdAfx.cpp
1>c:\users\yangtao\desktop\new folder\duilib\Control/UIFlash.h(10): warning C4192: automatically excluding 'IServiceProvider' while importing type library '..\Utils/Flash11.tlb'
1>  UIWebBrowser.cpp
1>c:\program files\windows kits\8.0\include\um\dispex.h(228): error C2371: 'IDispatchEx' : redefinition; different basic types
1>          c:\program files\windows kits\8.0\include\um\dispex.h(45) : see declaration of 'IDispatchEx'
1>c:\program files\windows kits\8.0\include\um\dispex.h(455): error C2872: 'IDispatchEx' : ambiguous symbol
1>          could be 'c:\program files\windows kits\8.0\include\um\dispex.h(228) : IDispatchEx'
1>          or       'c:\users\yangtao\desktop\new folder\duilib\build\debug_u\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx'
1>c:\program files\windows kits\8.0\include\um\dispex.h(791): error C2371: 'ICanHandleException' : redefinition; different basic types
1>          c:\program files\windows kits\8.0\include\um\dispex.h(73) : see declaration of 'ICanHandleException'
1>c:\program files\windows kits\8.0\include\um\dispex.h(977): error C2872: 'IDispatchEx' : ambiguous symbol
1>          could be 'c:\program files\windows kits\8.0\include\um\dispex.h(228) : IDispatchEx'
1>          or       'c:\users\yangtao\desktop\new folder\duilib\build\debug_u\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx'
1>c:\program files\windows kits\8.0\include\um\dispex.h(995): error C2872: 'IDispatchEx' : ambiguous symbol
1>          could be 'c:\program files\windows kits\8.0\include\um\dispex.h(228) : IDispatchEx'
1>          or       'c:\users\yangtao\desktop\new folder\duilib\build\debug_u\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx'
1>C:\Program Files\Windows Kits\8.0\Include\um\mshtml.h(9754): error C2872: 'IDispatchEx' : ambiguous symbol
1>          could be 'c:\program files\windows kits\8.0\include\um\dispex.h(228) : IDispatchEx'
1>          or       'c:\users\yangtao\desktop\new folder\duilib\build\debug_u\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx'
1>C:\Program Files\Windows Kits\8.0\Include\um\mshtml.h(9778): error C2872: 'IDispatchEx' : ambiguous symbol
1>          could be 'c:\program files\windows kits\8.0\include\um\dispex.h(228) : IDispatchEx'
1>          or       'c:\users\yangtao\desktop\new folder\duilib\build\debug_u\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx'

Duilib編譯出錯

 

解決方案:

修改UIWebBrowser.cpp和UIWebBrowser.h:

修改前:

修改前

修改后:

修改后

 

女孩不哭 @ cnblogs.com/memset @ 2014-05-11


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM