Visual Studio property sheets: Why is Character Set missing?

孤者浪人 提交于 2019-12-05 02:27:24

问题


I'm using Visual Studio 2010 SP1. I notice that I can add property sheets to a project but I cannot change the character set in those property sheets. Any property sheet I create is missing the 'Character Set' option.

Can anyone explain why I can't set the character set using a property sheet? Is there some list of forbidden properties that can't be set using a property sheet?

Thanks


回答1:


Ok I did some searching on my hard drive and found the answer.

Project Defaults, which Character Set is a part of, define which default MSBuild property sheets to inherit. Therefore when you choose Character Set in your project you are not changing preprocessor defines in your project file, and instead your project file will inherit a character set property sheet which changes those defines. If you do not choose a character set then no property sheet is inherited.

The Unicode and MBCS property sheets are located here:

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.MultiByteCharSupport.props
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.unicodesupport.props

The MBCS property sheet only adds _MBCS to the compiler's preprocessor defines (C/C++ Preprocessor Definitions). The Unicode property sheet only adds UNICODE and _UNICODE to both the compiler's preprocessor defines (C/C++ Preprocessor Definitions) and the resource compiler's defines (Resources Preprocessor Definitions). And that's it.



来源:https://stackoverflow.com/questions/12343438/visual-studio-property-sheets-why-is-character-set-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!