升级我的 c++ 后看到许多编译错误项目到 VS19
我用 VS17 构建了一个 C++ dektop 项目。 现在由于某些要求,我需要将其迁移到 VS19。
在使用 VS19 进行更改编译我的项目后,我看到许多错误,如下所示:
- C3646 'OVERRIDE': Unknown override specifier
- C2039: 'wstring': is not a member of 'std'
我找到了此链接 - https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c3646?view=msvc-170
但找不到它对解决我的问题有用。
我正在寻找一个简单的修复方法,比如是否有办法在 VS19 中使用 VS17 c++ 编译器。
I had built a c++ dektop project with VS17.
Now due to certain requirements, I needed it to migrate to VS19.
After making changes to compile my project with VS19, I am seeing many errors like below:
- C3646 'OVERRIDE': unknown override specifier
- C2039: 'wstring': is not a member of 'std'
I found this link - https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c3646?view=msvc-170
but could not find it useful to fix my issue.
I am looking for an easy fix, like if there is a way to use VS17 c++ compiler in VS19.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与其返回到旧的编译器,您最好逐一解决错误:
OVERRIDE:可能在项目中的某处定义为宏。找出
OVERRIDE
被解析为什么值。将光标放入单词OVERRIDE
以获取值。可能由于某种原因未正确包含相应的包含文件。您的旧项目是否包含全局定义的强制包含?wstring:要被识别为 std::wstring,您必须包含
。检查您的
UNICODE
设置。它们确定字符串中 8 字节字符与多字节字符的使用。查看解决方案属性中的配置属性/高级/字符集
。Rather than going back to the old compiler, you might be better off tackling the errors one-by-one:
OVERRIDE: is probably defined as macro somewhere in your project. Find out, what value
OVERRIDE
is being resolved to. Put the cursor into the wordOVERRIDE
to get the value. It could be that the respective include file is not properly included for some reason. Does your old project include a forced include for global definitions?wstring: to be recognized as std::wstring, you have to include
<string>
.Check your
UNICODE
settings. They determine the usage of 8-byte vs. multi-byte characters for strings. Look atConfiguration Properties / Advanced / Character Set
in the solution properties.可以使用项目属性中的“平台工具集”选项在 VS 2019 中使用 VS 2017 编译器。对于此设置,请安装 VS 2017 Platform 工具集,然后在 VS 2019 中打开项目并转到:
属性/配置属性/常规/平台工具集:Visual Studio 2017(V141)
It is possible to use VS 2017 compiler in VS 2019 using "platform toolset" option in properties of project. For this setting install VS 2017 Platform toolset then open project in VS 2019 and go to:
properties/Configuration properties/General/Platform toolset: Visual Studio 2017(V141)