禁用 C++ 预编译头文件 [英] C++ Precompiled Header Disabled

查看:55
本文介绍了禁用 C++ 预编译头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio 2015 中,我有一个带有以下错误的 C++/CLI 项目:

In Visual Studio 2015, I have a C++/CLI project with the following error:

致命错误 C1010:在查找预编译头文件时出现意外的文件结尾.您是否忘记在源代码中添加#includestdafx.h"?"

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

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

I turned off precompiled headers in the project options but it keeps giving me the same error. I even removed the name of the precompiled header file but it still says "stdafx.h".

是的,每个源文件都没有单独启用.

Yes, every source file indivuduially doesn't have it enabled.

推荐答案

好的.Hans Passant 发现了正在发生的事情:

Ok. Hans Passant found out what was happening:

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

The build configuration that I used to build it still had precompiled headers enabled.

这篇关于禁用 C++ 预编译头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆