简体   繁体   English

C2337 'importidl': 将解决方案升级到 VS2019 ( 16.9.2 ) 后找不到属性错误

[英]C2337 'importidl': attribute not found error after upgrading solution to VS2019 ( 16.9.2 )

I am updating a project to compile with VS2019 and turns out that importidl is no longer supported in VS2019 ( 16.9.2 ).我正在更新一个项目以使用 VS2019 编译,结果发现VS2019 ( 16.9.2 ) 不再支持 importidl 。 Comparing the generated.tlb prior to updating to VS2019 and after the binary file is much smaller resulting in a broken COM interface.在更新到 VS2019 之前和之后比较生成的.tlb 二进制文件要小得多,从而导致 COM 接口损坏。

The error I am getting is C2337 'importidl':attribute not found .我得到的错误是C2337 'importidl':attribute not found

The importidl is surrounded by a warning suppression: importidl被警告抑制包围:

#pragma warning(disable: 4467)
[ importidl(COM\\dummy.idl) ];
#pragma warning(pop)

C4467: usage of ATL attribute is deprecated

The Microsoft documentation leads to believe that imporidl had not been deprecated or removed. Microsoft 文档导致人们相信imporidl没有被弃用或删除。 However, it has been last updated 2 years ago and the warnings and errors are leading me to believe that there is a discrepancy on the documentation.然而,它最近一次更新是在 2 年前,警告和错误让我相信文档存在差异。

What is the alternative to go around the removed importidl ?删除的 importidl 周围importidl的替代品是什么?

In order to fix this issue with VS2019, I added a /permissive flag to the command line option.为了解决 VS2019 的这个问题,我在命令行选项中添加了/permissive标志。 Setting the conformance mode to "No" along with the std:c++latest did not work.将一致性模式设置为“否”以及std:c++latest不起作用。 std:c++latest is probably overriding /permissive . std:c++latest可能会覆盖/permissive

在此处输入图像描述

Keeping the conformance mode to Default , with the latest /std:c++latest language standard and adding /permissive as an additional Options to the command line property goes around the error C2017 Importidl attribute not found .将一致性模式保持为Default ,使用最新的/std:c++latest语言标准并将/permissive作为附加选项添加到命令行属性可以绕过错误C2017 Importidl attribute not found 在此处输入图像描述

暂无
暂无

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

相关问题 libtorch 在 Windows 10 (VS2019) 上构建后抛出 c10::error - libtorch throws c10::error after build on Windows 10 (VS2019) SignTool 错误:未找到符合所有给定条件的证书。 VS2019 - SignTool error : No certificates were found that met all the given criteria. vs2019 构建 static libcurl VS2019 时出错 - Getting an error building static libcurl VS2019 Windows + VS2019 + CMake + CLion + Conan:如何启用 C++20? - Windows + VS2019 + CMake + CLion + Conan: How to enable C++20? VS2019 C++跨平台程序中包含nuget封装 - Including nuget packages in VS2019 C++ cross platform program Windows 更新到 1909 后,在 VS Studio 2019 中构建我的解决方案时出现此错误 - After windows update to 1909, getting this error while building my solution in VS Studio 2019 每当我在“基本”环境中启动 Anaconda Prompt 时,都会出现有关 VSINSTALLDIR 和 vs2019 的长错误消息 - Long error messages about VSINSTALLDIR and vs2019 whenever I start Anaconda Prompt in my "base" environment 将解决方案升级到Windows 8.1后出现神秘的构建错误 - Getting mysterious build error after upgrading solution to Windows 8.1 带有__disable()和__enable()函数的C/C++代码在VS2019发布优化O1和Od速度下无法编译 - C/C++ code with __disable() and __enable() functions cannot be compiled under VS2019 release optimization speeds of O1 and Od Trying to compile libpng VS2019 options.awk: bad line (10): com CMake Error at scripts/gensrc.cmake:68 (message): Failed to generate pnglibconf.tf5 - Trying to compile libpng VS2019 options.awk: bad line (10): com CMake Error at scripts/gensrc.cmake:68 (message): Failed to generate pnglibconf.tf5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM