即使在安装 VC++ 2017 可再发行组件后,带有动态链接 VC++ 的 Windows 10 应用程序也不会启动 [英] Windows 10 app with dynamically linked VC++ does not start even after installation of VC++ 2017 redistributable

查看:23
本文介绍了即使在安装 VC++ 2017 可再发行组件后,带有动态链接 VC++ 的 Windows 10 应用程序也不会启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在 Beta 版测试 Windows 应用程序,该应用程序使用最新的 C++ Visual Studio 构建并在 Windows 10 上运行.该应用程序动态链接 VC++ 库(静态链接不是我们的选项).

We're currently beta testing a Windows application which is built with the latest Visual Studio in C++ and runs on Windows 10. The application dynamically links the VC++ libraries (static linkage is not an option for us).

在我们测试人员的 75% 的机器(包括我们所有的开发机器)上,应用程序在安装后开箱即用,但在其他一些机器上,它在加载动态系统库的过程中无法启动和失败(大概)(因为它不会触发任何会像运行时错误一样写入小型转储的异常).

On 75% of our testers' machines (including all our dev machines), the application works out of the box after installing, but with some others it does not start and fails (presumably) during the process of loading dynamic system libraries (since it does not trigger any kind of exception that would write a minidump as with runtime errors).

  1. 其中一些用户遇到了缺少运行时 dll 的错误,这些错误在安装最新的 VC++ 2017 可再发行组件后得到解决,但应用程序仍然无法运行.
  2. 一位用户还使用依赖项工具 (https://github.com/lucasg/依赖),但他的结果没有显示出什么奇怪的 - 工作机器上的输出和他自己的输出之间没有明显的区别.有几个问号(请参见屏幕截图:缺少模块,如依赖项中所示)接下来某些 UCRT 子依赖项,但它们也存在于工作机器上,所以我认为它们是误报.
  3. 我还尝试将相关的 40 个 UCRT 和 VC++ dll 部署为可执行文件旁边的应用程序本地部署,但它仍然无法在受影响的机器上打开(我可能错过了一些相关的,或者它们是仍然从 System32 文件夹中引用)
  1. Some of these users have had errors about missing runtime dlls which were solved after installing the latest VC++ 2017 redistributable, however the application still would not run.
  2. One user has also checked the library dependencies with the Dependencies tool (https://github.com/lucasg/Dependencies), but his results show nothing strange - there is no obvious difference between the output on a working machine and on his own. There are a few question marks (see screenshot: missing modules as shown in Dependencies) next to some UCRT subdependencies but they are there on working machines as well so I presume they are false positives.
  3. I've also tried to deploy the relevant 40 something UCRT and VC++ dlls as an app local deploy next to the executable but it still wouldn't open on the affected machines (I might have missed some relevant ones, or they were still referenced from the System32 folder)

如果我们无法在本地重现它(它可以在两个全新的设备上开箱即用,安装了全新的 Windows 10 并且没有构建环境)和 关于库调用可能出现什么问题的信息很少?

How would you debug such a problem, providing we cannot reproduce it locally (it works out of the box on two completely new devices with a fresh Windows 10 install and without a build environment) and there is a very little information on what might be going wrong with the library calls?

推荐答案

c000001d 是非法指令异常代码.

c000001d is illegal instruction exception code.

要么您的目标是客户 CPU 不支持的指令集,如 AVX2 或 SSE4.1,要么可执行文件已损坏(例如,以文本模式而不是二进制模式下载).

Either you are targeting instruction sets like AVX2 or SSE4.1 which the customer CPU doesn't support, or the executable is corrupted (e.g. downloaded in text mode instead of binary mode).

为了获得最佳的可移植性,在使用 VC++ 编译时不要指定 /arch:AVX/arch:AVX2.然后,编译器将针对给定架构(x86 或 x86_64 和 SSE2)上可用的基本指令集.

For best possible portability do not specify /arch:AVX or /arch:AVX2 when compiling with VC++. The compiler will then target the base instruction set available on the given architecture (x86 or x86_64 with SSE2).

这篇关于即使在安装 VC++ 2017 可再发行组件后,带有动态链接 VC++ 的 Windows 10 应用程序也不会启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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