一个独立的算法类实现和头文件加入到原有编译通过的Win32程序后,编译出现如下错误:
c:\ftp\des.cpp(454) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
请问是什么原因?

解决方案 »

  1.   

    add #include "stdafx.h"  in your cpp file
      

  2.   

    By default, Visual C++ projects use precompiled headers. This is a system whereby the large Windows headers are compiled only once when you build stdafx.cpp. Every other .CPP file in your project needs to #include "stdafx.h" as the first #include in order to build. The compiler specifically looks for the name "stdafx.h" to know when to insert the precompiled header information.If you received the source for an entire program from someone else, and you want to build it as a Visual C++ project, you can turn off precompiled headers instead. In your project options, go to the C/C++ tab and select the Precompiled headers category. Click the Not using precompiled headers radio button, then click OK.