即使我在属性页中更改了Platform Toolset,为什么_MSC_VER不会更改。 [英] Why does _MSC_VER not change, even if I have changed a Platform Toolset in property page.

查看:312
本文介绍了即使我在属性页中更改了Platform Toolset,为什么_MSC_VER不会更改。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2017,我为Visual Studio 2015安装了Platform Toolset(v140)。

I am using Visual Studio 2017, and I installed Platform Toolset for Visual Studio 2015 (v140).

我选择在属性页中使用Visual Studio(v140) 。但预定义的宏保持不变。

I selected to use Visual Studio (v140) in the property pages. But the predefined macros stay the same as it were.

_MSC_VER = 1916

_MSC_VER = 1916

_MSVC_LANG =  201703L 

_MSVC_LANG = 201703L 

这没有任何意义。是否应更改为:

This doesn't make any sense. Should they be changed to :

_MSC_VER = 1900

_MSC_VER = 1900

_MSVC_LANG =  201402L 

_MSVC_LANG = 201402L 

有没有人知道我应该更改哪些其他配置以使用较小的_MSC_VER和_MSVC_LANG?

Does anyone have an idea what other configuration should I change to use the smaller _MSC_VER and _MSVC_LANG?

推荐答案

嗨朋友,

欢迎来到MSDN论坛。

Welcome to MSDN forum.

我无法在vs2017中重现同样的问题。 这两个值似乎受到不同因素的影响。

I can't reproduce same issue at my side in vs2017.  And these two values seem to be affected by different factors.

当我设置v140时,_MSC_VER是1900,当我选择v141时,vslue是1916.这个改变在我这边很好。所以我想如果你有VS IDE或v140工具集包破坏了什么。请将您的vs更新到最新的15.9.7版本并检查它是否
有效。如果没有,我建议您重新安装v140软件包。

When i set v140, the _MSC_VER is 1900 and when i choose v141, the vslue is 1916. The change works well at my side. So i guess if you have something broken with VS IDE or v140 toolset package. Please update your vs to latest 15.9.7 version and check if it works. If not, i suggest you reinstall the v140 package.

对于_MSVC_LANG,如果更改C ++语言标准,结果如何(Go Project Properties => C\C ++ =>语言)到C ++最新版本或C ++ 17或C ++ 14.它是否会影响您的机器? 

For _MSVC_LANG, what about the result if you change the C++ Language standard(Go Project Properties=>C\C++=>language) to C++ latest or C++17 or C++ 14. Does it makes difference in your machine? 

注意:此选项仅在您选择平台工具集v141时显示,因此我建议您先选择v141,然后找到C ++语言标准属性并将其设置为最新。之后,您可以继续将v141更改为v140,更改
可以正常工作。

Note: This option only displays when you choose platform toolset v141, so I suggest you choose v141 first, and then find the C++ language standard property and set it to latest. After that, you can continue to change the v141 to v140, the change can work.

我已经完成了一些测试并发现_MSC_LANG的值确实有事情要做根据

this doc
。图片如下:

I've done some tests and find the value of _MSC_LANG do have something to do with it according this doc. Pic is as below:

希望以上所有有帮助。期待您的回复。

Hope all above helps. Looking forward to your reply.

最好的问候

Lance


这篇关于即使我在属性页中更改了Platform Toolset,为什么_MSC_VER不会更改。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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