【问题标题】:setting VCCLCompilerTool.TreatWChar_tAsBuiltInType property on MSBuild command line在 MSBuild 命令行上设置 VCCLCompilerTool.TreatWChar_tAsBuiltInType 属性
【发布时间】:2013-05-15 12:16:34
【问题描述】:
我需要使用 wchar_t not 作为原生类型来构建 Visual Studio 2010 项目。 IDE 设置应等于VCCLCompilerTool.TreatWChar_tAsBuiltInType 属性的值。但是,尝试在 MSBuild 命令上使用 /p:VCCLCompilerTool.TreatWChar_tAsBuiltInType=false 设置它似乎失败了。有没有其他方法可以从 MSBuild 命令行实现这一目标?
【问题讨论】:
标签:
c++
visual-studio-2010
msbuild
【解决方案1】:
您必须将环境变量 CL 设置为 /Zc:wchar_t-
使用强制 /Zc:wchar_t-: 编译的示例批处理文件
set CL=/Zc:wchar_t-
%windir\Microsoft.NET\Framework\v4.0.30319\msbuild.exe projectName.vcxproj /t:Rebuild