问题描述
正如标题所说。我有一个C ++项目,并增加1℃的.h文件和C .C源文件,但由于项目的其余部分采用了precompiled头,他们有问题,但如果我尝试把它列入与C文件,它给出了一个错误。我不能只禁用precompiled头为整个项目,因为它是使用它和别人有code一个更大的项目的一部分。
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?
感谢。
推荐答案
突出显示在Solution Explorer中的文件,并按下Alt / F7。这将打开该文件的属性;在precompiled头中的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.
这篇关于禁用precompiled标头在VC ++ 2010项目中的特定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!