1. 程式人生 > >解決錯誤 fatal error C1010: unexpected end of file while looking for precompiled head

解決錯誤 fatal error C1010: unexpected end of file while looking for precompiled head

 

在編譯VS時候,出現fatal error C1010: unexpected end of file while looking for precompiled head。

 

 

問題詳細解釋:致命錯誤C1010,在尋找預編譯指示標頭檔案時,檔案未預期結束。就是沒有找到預編譯指示資訊的問檔案。

顧名思義就是預編譯因為缺少了預編譯檔案而失敗。解決方法顯然可以取消預編譯,或者幫助編譯器找到預編譯檔案。

故解法:

1.右鍵單擊專案工程中的cpp檔案,在選單Project->XXXproperties->C/C++->Precompile Header,設定為第一項:Not using precompile headers。

2.在.cpp檔案開頭新增包含檔案stdafx.h。 #include"stdafx.h"