VS2017从15.4.1升级到15.5.1导致生成错误 [英] Upgrading VS2017 from 15.4.1 to 15.5.1 resulted in build error
问题描述
我正在使用以下工具/版本进行编程:Windows 10/VS2017 Professional/C ++
I'm programming with the following tools/versions: Windows 10 / VS2017 Professional / C++
升级到15.5.1后,出现以下错误:
After I upgraded to 15.5.1 I got the following error:
MIDL2338:切换是矛盾的– no_robust与-目标
MIDL2338: switches are contradictory - no_robust vs. - target
Microsoft编译器错误描述列表显示:编译IDL文件时,不能同时使用/osf和/ms_ext命令行开关.
The Microsoft compiler error description list says: You cannot use both the /osf and /ms_ext command-line switches when you compile an IDL file.
这些开关中没有一个在我的项目属性中指定.
None of those switches are specified in my project properties.
我试图降级到15.4.1,但是发现除非是N-1,否则不可能还原到旧版本.这是基于我读过的许多博客(包括Stack Overflow).
I tried to downgrade back to 15.4.1 but have found that it's impossible to revert to an old version unless it's N-1. This is based on the many blogs I've read (including Stack Overflow).
我碰壁了,处于停滞状态,直到我弄清楚了这个切换问题.
I have hit a wall and am at a standstill until I figure out this switch issue.
非常感谢您的帮助.
推荐答案
我刚才遇到了相同的问题,但是幸运的是,我确实可以访问另一个较旧的安装.
I ran into the same problem just now, but luckily I do have access to another, older, installation.
这是VS 2017 15.4.4下的命令行:
Here is the command line under VS 2017 15.4.4:
/iid "RtdHandleServer_i.c" /env win32 /h "RtdHandleServer.h" /W1 /char signed /tlb "Win32\Release\RtdHandleServer.tlb" /Oicf /D "NDEBUG" /no_robust /nologo /proxy "RtdHandleServer_p.c"
这是在VS 2017 15.5.1中更改为的内容:
Here is what it is changed to under VS 2017 15.5.1:
/iid "RtdHandleServer_i.c" /env win32 /h "RtdHandleServer.h" /W1 /char signed /tlb "Win32\Release\RtdHandleServer.tlb" /Oicf /target "NT60" /D "NDEBUG" /no_robust /nologo /proxy "RtdHandleServer_p.c"
所以所有更改只是添加了一个新参数/target"NT60" ,大概是新的默认值.
So all that has changed is that a new parameter /target "NT60" has been added, presumably as a new default.
在我看来,有两种方法可以解决此问题:
It looks to me as if there are two ways to address this:
- 在idl文件的属性页"对话框中,转到配置属性">"MIDL">高级",然后清除最小目标系统"的值.
- 摆脱-no_robust标志.根据文档(
如果生成的存根需要在Microsoft Windows NT,Windows 95/98或Windows Me上运行,则必须使用/no_robust命令行开关来禁用/robust功能."
"The /no_robust command line switch must be used to disable the /robust feature if generated stubs need to run on Microsoft Windows NT, Windows 95/98, or Windows Me."
无论哪种更改都对消除错误有效,但第一种方法的影响最小.
Either change works for me in terms of getting rid of the error, but the first method has the least impact.
PS. I think that the MS error description (https://msdn.microsoft.com/en-us/library/windows/desktop/aa366756%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396) is likely to be incorrect in this instance. The original error message that you are seeing refers to two specific flags, /no_robust and /target, not to /osf and /ms_ext.
这篇关于VS2017从15.4.1升级到15.5.1导致生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!