酷知百科網

位置:首頁 > 遊戲數碼 > 電腦

include stdafx.h 無法開啟源檔案怎麼辦

電腦1.72W

我們編程的時候會用到許許多多的頭檔案,那麼當系統提示
include stdafx.h頭檔案錯誤,無法開啟的時候怎麼辦呢?別急,看過來,小編帶你解決問題帶你飛。

操作方法

(01)爲了更加簡潔的說明,小編用來cfree5來講解說明。首先,看下include stdafx.h檔案報錯。

include stdafx.h 無法開啟源檔案怎麼辦

(02)接着我們找到cfree5的捷徑,然後鼠標單擊右鍵,開啟檔案位置。

include stdafx.h 無法開啟源檔案怎麼辦 第2張

(03)在cfree檔案夾裏面找到“mingw”這個子檔案夾。

include stdafx.h 無法開啟源檔案怎麼辦 第3張

(04)然後找到“include ”這個檔案夾,這個是存放頭檔案的檔案夾。

include stdafx.h 無法開啟源檔案怎麼辦 第4張

(05)可以看到這裏並沒有stdafx.h這個頭檔案,這就是編程報錯的原因。

include stdafx.h 無法開啟源檔案怎麼辦 第5張

(06)知道錯誤原因就很好解決了,網上下載一個stdafx.h頭檔案就可以了。

include stdafx.h 無法開啟源檔案怎麼辦 第6張

(07)把stdafx.h頭檔案放到對應的檔案夾裏面就可以了。

include stdafx.h 無法開啟源檔案怎麼辦 第7張

(08)如圖所示,完美解決了報錯的問題,是不是很簡單很神奇呢?

include stdafx.h 無法開啟源檔案怎麼辦 第8張