Error 1 fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? d:/3_code/vc/forceincludedemo/forceincludedemo/demo.cpp 11
要是能不添加stdafx.h也能有預(yù)編譯這個(gè)功能就好了。
ForceIncludes 經(jīng)過(guò)一番查找,我發(fā)現(xiàn)在編譯器中提供了一個(gè)/FI (Name Forced Include File)的選項(xiàng)。 通過(guò)使用這個(gè)選項(xiàng)就可以避免這樣的事情發(fā)生了。 這個(gè)參數(shù)的設(shè)置在工程的“屬性”對(duì)話框中,具體是C++下面Advanced中的Force Includes屬性。 如圖: