c++ - 在 Windows Server 2012 上运行 VS2019 编译的应用程序需要什么?
问题描述
最近我用 VS2019 编写了一个程序,调用用 C++ (x64) 编译的 Tesseract OCR dll 并在 .NET Windows 窗体上显示结果。在我的 Windows 10 开发 PC 上一切正常。当部署到 Windows Server 2012 (x64) 时,它崩溃了,抱怨找不到 C++ dll。
我尝试了什么:
- 安装微软的vc_redist.x64.exe,还是不行。(可能还不够?)
- 在该服务器上运行一个简单的 .NET Windows 窗体程序,它运行良好。(这不是 .NET 问题)
更新:
我使用了@Fenixil 建议的 Dependency Walker,但未找到以下 dll:
- API-MS-WIN-CORE-KERNEL-32-PRIVATE-L1-1-1.DLL
- API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
- API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
- MF.DLL
- MFPLAT.DLL
- MFREADWRITE.DLL
- API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
- EXT-MS-WIN-NTUSER-UICONTEXT-EXT-L1-1-0.DLL
- IESHIMS.DLL
- 设置同步策略.DLL
- WLANAPI.DLL
这些 dll 可以在我的开发 PC 中找到,在 C:/Windows/WinSxS 中,在不同目录下有多个同名文件。它们属于某些 Windows SP 更新,还是在 Win10 平台 API 中?安装它们而不是简单地将它们复制到生产服务器的最佳方法是什么?
解决方案
vc_redist 有多个版本,您需要提供一个在您的应用程序中使用的版本。这是一些与 vc_redist not found 的讨论,可能与您的问题有关。
您可以使用Dependency Walker工具检查系统中缺少哪些 dll
推荐阅读
- c - 如何从C中的浮点类型中删除点?
- php - php如何做一个循环来计算测验网站的分数
- java - 是否可以在不限制大小的情况下创建无限流?
- ubuntu - 使用“apt”时,如何避免出现 postfix 错误 75?
- arrays - 比较两个文本文件,相同的点,不同的点描述
- c++ - 将 std::wstring 转换为 WCHAR 数组
- javascript - TypeError:无法读取未定义的属性“消息”
- html - 子元素的 CSS 不起作用,但父元素的 CSS 工作正常
- swift - 如何在 MacOS 上更改 SwiftUI 默认按钮的尺寸?
- android - Android Studio Artic Fox - Java 和 Kotlin JVM 目标 - 8 对 11