简体   繁体   English

将我的 c++ 项目升级到 VS19 后看到许多编译错误

[英]Seeing many compilation errors after upgrading my c++ project to VS19

I had built a c++ dektop project with VS17.我用 VS17 构建了一个 c++ dektop 项目。 Now due to certain requirements, I needed it to migrate to VS19.现在由于某些要求,我需要它迁移到 VS19。

After making changes to compile my project with VS19, I am seeing many errors like below:在对使用 VS19 编译我的项目进行更改后,我看到很多错误,如下所示:

  1. C3646 'OVERRIDE': unknown override specifier C3646 'OVERRIDE':未知的覆盖说明符
  2. C2039: 'wstring': is not a member of 'std' C2039: 'wstring': 不是 'std' 的成员

I found this link - https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c3646?view=msvc-170我找到了这个链接 - 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.我正在寻找一个简单的修复方法,比如是否有办法在 VS19 中使用 VS17 c++ 编译器。

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. OVERRIDE :可能在您的项目中某处定义为宏。 Find out, what value OVERRIDE is being resolved to.找出OVERRIDE被解析为什么值。 Put the cursor into the word OVERRIDE to get the value.将 cursor 放入OVERRIDE字中得到值。 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> . wstring :要被识别为 std::wstring,您必须包含<string>
Check your UNICODE settings.检查您的UNICODE设置。 They determine the usage of 8-byte vs. multi-byte characters for strings.它们决定了字符串使用 8 字节还是多字节字符。 Look at Configuration Properties / Advanced / Character Set in the solution properties.查看解决方案属性中的Configuration Properties / Advanced / Character Set

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

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