2008-09-23 166 views
2

我把我們的項目之一從VS6到VS2008的過程是編譯和我打同mshtml.h以下編譯錯誤:編譯mshtml.h錯誤與VS2008

1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5272) : error C2143: syntax error : missing '}' before 'constant' 
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5275) : error C2143: syntax error : missing ';' before '}' 
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5275) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2059: syntax error : '}' 
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2143: syntax error : missing ';' before '}' 
1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2059: syntax error : '}' 

繼第一個錯誤的語句刪除到mshtml.h這部分代碼,在「真= 1」行指出:

EXTERN_C const GUID CLSID_CDocument; 
EXTERN_C const GUID CLSID_CScriptlet; 
typedef 
enum _BoolValue 
    { True = 1, 
    False = 0, 
    BoolValue_Max = 2147483647L 
    } BoolValue; 

EXTERN_C const GUID CLSID_CPluginSite; 

它看起來像有人在專家sexchange碰到這個錯誤也來了,但我寧願不要以「7天免費試用」來尊重該網站。

任何建議將是最受歡迎的。

+0

一直滾動到該頁面的底部 - 答案將在那裏unobscured – 2008-09-23 01:58:41

回答

1

有可能是#define改變了一些東西。試着在.cpp上運行預處理器並生成一個.i文件。該設置位於項目屬性頁面中。

編輯:另外,您可以通過滾動到頁面底部從其他專家網站獲得答案。他們必須這樣做,否則谷歌會將他們帶出索引。

1

在當前編譯文件中有什麼其他代碼?可能是True已被宏定義爲1。這將解釋錯誤。

2

,你可能已經有符號真&假定義,包括文件之前嘗試

#undef True 
#undef False 

+0

你是對的,我按照你的指示解決了問題。 – 2014-11-20 19:19:32

0

謝謝你們。我找到了那些#undef's的正確位置。我把它們放到類頭文件中,就在似乎要做的一個#include <atlctl.h>之前。

並感謝關於其他專家網站的提示,我必須牢記這一點。