調試出現一大堆錯誤···

1>c:\program files\microsoft sdks\windows\v6.0a\include\tlhelp32.h(30) : error C2146: 語法錯誤 : 缺少“;”(在標識符“WINAPI”的前面)
1>c:\program files\microsoft sdks\windows\v6.0a\include\tlhelp32.h(30) : error C4430: 缺少類型說明符 - 假定爲 int。注意: C++ 不支持默認 int
1>c:\program files\microsoft sdks\windows\v6.0a\include\tlhelp32.h(30) : error C2146: 語法錯誤 : 缺少“;”(在標識符“CreateToolhelp32Snapshot”的前面)
1>c:\program files\microsoft sdks\windows\v6.0a\include\tlhelp32.h(30) : error C4430: 缺少類型說明符 - 假定爲 int。注意: C++ 不支持默認 int
1>c:\program files\microsoft sdks\windows\v6.0a\include\tlhelp32.h(31) : error C2065: “DWORD”: 未聲明的標識符
1>c:\program files\microsoft sdks\windows\v6.0a\include\tlhelp32.h(223) : fatal error C1003: 錯誤計數超過 100;正在停止編譯

後來發現是頭文件的位置有問題
錯誤的時候是這樣:
#include <stdio.h>
#include <tlhelp32.h>
#include <windows.h>

改正後,正確運行:
#include <stdio.h>
#include <windows.h>
#include <tlhelp32.h>

發佈了59 篇原創文章 · 獲贊 15 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章