1. 程式人生 > >fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory

fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory

When you start a new Win32 console project (File, New, Project, ...) do not select the "Empty Project" checkbox.  When that checkbox is off you will get a new project that has a stdafx.h file, and also you will get the proper settings for all the compiler options.

當你要新建一個win32 console project(File , New, Project,...)控制檯應用程式,不要選擇“一個空的程式(Empty Project)”.選擇其它任何一個選項,都可以得到一個包含了stdafx.h的新工程,同時也能使用正確的編譯選項