2010-11-09 57 views
0

我參考了一些包含對平臺sdk的依賴的包含。當我將下面的行添加到我的QT造物主臨文件,並嘗試編譯它拋出混亂的錯誤:在QT Creator中包含Platform SDK

INCLUDEPATH += "C:\Program Files\Microsoft Platform SDK\Include"

的錯誤是:

c:\Program Files\Microsoft Platform SDK\Include/winnt.h:666: error: #error Must define a target architecture.

c:\Program Files\Microsoft Platform SDK\Include/oaidl.h:442: error: pasting "/" and "/" does not give a valid preprocessing token

c:\Program Files\Microsoft Platform SDK\Include/oaidl.h:457: error: pasting "/" and "/" does not give a valid preprocessing token

c:\Program Files\Microsoft Platform SDK\Include/propidl.h:310: error: pasting "/" and "/" does not give a valid preprocessing token

c:\Program Files\Microsoft Platform SDK\Include/oaidl.h:442: error: expected unqualified-id before '/' token

c:\Program Files\Microsoft Platform SDK\Include/oaidl.h:457: error: expected unqualified-id before '/' token

c:\Program Files\Microsoft Platform SDK\Include/propidl.h:310: error: expected unqualified-id before '/' token

任何幫助是極大的讚賞

回答

1

嘗試用\替換\。

+0

這沒有幫助的情況,但謝謝你的想法。 – Rufius 2010-11-09 17:03:56

0

我可以解釋第一個錯誤。 winnt.h正期待着一個#define以下任何一個,以及更多,對應於目標體系結構:_M_IX86 _M_IA64 _M_AMD64 _M_ARM有一些這些。這適用於winnt.h的Windows SDK 8.0(2012年11月)版迭代。

您可以在項目文件(而不是代碼中)中定義此項,如果您有不同的構建配置,這可能會很有用。向您的項目(.pro)文件中添加一個類似的行。

intelsixtyfourbitbuild:DEFINES += _M_IA64 

將開始部分從冒號(:)包含在內,不管是否構建都定義。