在VC ++ 2010项目中禁用特定文件的预编译头 [英] Disabling precompiled headers for a specific file in a VC++ 2010 project

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

问题描述

标题说。我有一个C ++项目,并添加了1个C .h文件和一个C .c源文件,但他们有问题,因为项目的其余部分使用预编译头,但如果我尝试将它包括在这些C文件,给出错误。我不能只为整个项目禁用预编译头文件,因为它是使用它的一个更大的项目的一部分,并且有其他人的代码。

As the title says. I have a C++ project, and added 1 C .h file and a C .c source file, but they are having problems because the rest of the project uses a precompiled header, but if I try to include it in those C files, it gives an error. I can't just disable precompiled headers for the whole project, because it's part of a larger project that uses it and has code by somebody else.

选择这两个C文件(.h头和.c源文件)并禁用PCH?

So is there a way to select those two C files (the .h header and .c source files) and disable PCH?

感谢。

推荐答案

在解决方案资源管理器点击Alt / F7。这将显示文件的属性;在预编译头下的C / C ++部分中,您将找到相关选项。您不需要担心.h文件。

Highlight the file in the Solution Explorer and hit Alt/F7. This will bring up the properties for the file; in the "C/C++" section under "Precompiled Headers" you'll find the relevant options. You don't need to worry about the .h files.

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

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