C++ 预编译 header 已禁用

标签 c++ visual-studio compiler-errors precompiled-headers

在 Visual Studio 2015 中,我的 C++/CLI 项目出现以下错误:

"fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?"

我在项目选项中关闭了预编译 header ,但它一直给我同样的错误。我什至删除了预编译头文件的名称,但它仍然显示 "stdafx.h"

编辑: 是的,每个源文件都没有单独启用它。

最佳答案

好的。 Hans Passant 发现了发生的事情:

我用来构建它的构建配置仍然启用了预编译 header 。

关于C++ 预编译 header 已禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33849418/

相关文章:

c++ - [] 不允许重载 C++ 函数数组

c++ - 图像边界框的周长

visual-studio - Visual Studio - 如何避免在每次构建时编译所有项目文件?

使用 Visual Studio 2008 的 2.0 中的 C# .NET 3.0/3.5 功能

c++ - g++ 发出难以理解的警告

c++ - 在多线程环境中使用 MPI_THREAD_SERIALIZED 时,所有 MPI 调用都需要锁吗?

c# - 使用数据库中的用户名和密码登录页面无法正常工作,不明白为什么

c++ - 如何获取c++ 20 std lib?

ios - swift : How to typecast an AnyObject to an NSArray in this situation?

c++ - GCC 编译类型错误 : expected type-specifier