简体   繁体   English

VS2008:如何使stdafx.h中定义的符号对资源编译器可见?

[英]VS2008: How do I make symbols defined in stdafx.h visible to the resource compiler?

I am working on a VC++ project under VS2008. 我正在VS2008下进行VC ++项目。 My resource files contain some pre-processor directives for conditional compilation. 我的资源文件包含一些用于条件编译的预处理器指令。 Some of the symbols controlling the conditional compilation are defined in stdafx.h . stdafx.h中定义了一些控制条件编译的符号。 I need these symbols to be visible to the resource compiler as well. 我还需要这些符号对资源编译器也可见。 How do I make this happen? 我如何做到这一点?

  • Right-click the resource file in the resource view 在资源视图中右键单击资源文件
  • Select Resource Includes... from the context menu 从上下文菜单中选择“ 资源包括...”
  • Insert #include "headerfile.h" 插入#include "headerfile.h"

However, I think you should not include stdafx from there, but extract the symbols to a seperate header, so that the resouce compiler is not confused with whatever else you might have in stdafx. 但是,我认为您不应从那里包括stdafx,而应将符号提取到单独的标头中,以使resouce编译器不会与stdafx中的其他内容混淆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM