質問: I don't know what happen about this error,this program i can run normaly early, I check include file, i have include file but it show this error message, I check SDK path ,it has be added include visual c++ include path --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Blockquote > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(222) : error C2065: 'STORAGE_PROPERTY_QUERY' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(222) : error C2146: 語法錯誤 : 遺漏 ';' (在識別項 'Query' 之前) > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(222) : error C2065: 'Query' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(223) : error C2065: 'Query' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(223) : error C2228: '.PropertyId' 的左邊必須有類別/結構/等位 > 1> 型別為 ''unknown-type'' > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(223) : error C2065: 'StorageDeviceProperty' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(224) : error C2065: 'Query' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(224) : error C2228: '.QueryType' 的左邊必須有類別/結構/等位 > 1> 型別為 ''unknown-type'' > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(224) : error C2065: 'PropertyStandardQuery' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(230) : error C2065: 'Query' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(231) : error C2065: 'STORAGE_PROPERTY_QUERY' : 未宣告的識別項 > 1>d:\myhim2\agent\common\commonlib_subsystem\src\cdrom.cpp(231) : error C2070: ''unknown-type'': sizeof 運算元不合法,必須是運算式或型別名稱 > 1>正在建立瀏覽資訊檔... > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(321) : error C2065: 'STORAGE_PROPERTY_QUERY' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(321) : error C2146: 語法錯誤 : 遺漏 ';' (在識別項 'query' 之前) > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(321) : error C2065: 'query' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(500) : error C2065: 'query' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(500) : error C2228: '.PropertyId' 的左邊必須有類別/結構/等位 > 2> 型別為 ''unknown-type'' > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(500) : error C2065: 'StorageAdapterProperty' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(501) : error C2065: 'query' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(501) : error C2228: '.QueryType' 的左邊必須有類別/結構/等位 > 2> 型別為 ''unknown-type'' > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(501) : error C2065: 'PropertyStandardQuery' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(506) : error C2065: 'query' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(507) : error C2065: 'STORAGE_PROPERTY_QUERY' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(507) : error C2070: ''unknown-type'': sizeof 運算元不合法,必須是運算式或型別名稱 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(580) : error C2065: 'query' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(580) : error C2228: '.PropertyId' 的左邊必須有類別/結構/等位 > 2> 型別為 ''unknown-type'' > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(580) : error C2065: 'StorageDeviceProperty' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(581) : error C2065: 'query' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(581) : error C2228: '.QueryType' 的左邊必須有類別/結構/等位 > 2> 型別為 ''unknown-type'' > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(581) : error C2065: 'PropertyStandardQuery' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(586) : error C2065: 'query' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(587) : error C2065: 'STORAGE_PROPERTY_QUERY' : 未宣告的識別項 > 2>d:\myhim2\agent\skagent\subsystems\him\build\subsystem_him\him_hd.cpp(587) : error C2070: ''unknown-type'': sizeof 運算元不合法,必須是運算式或型別名稱 > 2>正在產生程式碼... > > >
回答: It means "**STORAGE_PROPERTY_QUERY**' is not a valid identifier. See the exact pertaining doc here: . You need to add the **WinIoCtl.h** file to your C++ project.