c++ - Visual Studio "Application failed to start because the application configuration is incorrect"错误

标签 c++ visual-studio-2010 linker

我从 friend 那里获得了一些代码,在相同的系统(Windows 7)和相同的 Visual Studio Ultimate 2010 上开发。 ,所有库都相对映射。

代码构建,但是当尝试运行它时,我收到错误:

Application failed to start because the application configuration is incorrect"

正在运行Dependency Walker可执行文件上显示 msvcr90.dllieshishm.dllieframe.dllfreeglut.dll 无法被发现。我将它们复制到 execs 目录中并解决了这些问题。但是,仍然存在两个问题:

Error: The Side-by-Side configuration information for "e:\projects\darwin\code\debug\GLTEMPLATE.EXE" contains errors. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail (14001). Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

SHLWAPI.DLL 和 IEFRAME.DLL 模块被标记为红色(假设错误消息与这两个模块相关,我该如何解决这个问题?)。

此外,sxstrace 给出了以下结果:

Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = x86
    CultureFallBacks = en-US;en
    ManifestPath = E:\Projects\Darwin\Code\Debug\GLTemplate.exe
    AssemblyDirectory = E:\Projects\Darwin\Code\Debug\
    Application Config File =
INFO: Parsing Manifest File E:\Projects\Darwin\Code\Debug\GLTemplate.exe.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC90.DebugCRT(...)
INFO: Resolving reference Microsoft.VC90.DebugCRT
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
                INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.
(...)

还有一些类似的。

我还尝试按照其他相关帖子的建议将运行时库从多线程调试 DLL (/MDd) 更改为多线程调试 (/MTd)。但是,我得到:

MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _printf already defined in LIBCMTD.lib(printf.obj)

还有另外五个类似的。排除 LIBCMTD.lib 允许我构建。但是,我仍然无法运行该应用程序。我遇到了与一开始相同的错误。

出了什么问题以及如何解决这个问题?

到目前为止,没有其他相关帖子给我答案。

最佳答案

您的项目使用一个或多个使用 Visual Studio 2008(Visual Studio 的早期版本)构建的库。他们需要 C 运行时库才能使该版本可用;这就是它提示 msvcr90.dll 的原因。您已经安装了 Visual Studio 2010;您的计算机上只安装了 msvcr100.dll。

仅仅复制 msvcr90.dll 是行不通的;该 DLL 需要安装在 Windows 并行缓存中。您可以从 Microsoft 或您的 friend 那里获取安装程序。然而,这并不是真正的解决办法。您的应用程序仍然存在问题,具体取决于两个 CRT 版本。非常不健康,可能会导致难以诊断的崩溃和内存泄漏。您需要使用 Visual Studio 2010 重新构建库。这就是我的建议失败的地方;我无法从你的问题中猜出这些库是什么。

关于c++ - Visual Studio "Application failed to start because the application configuration is incorrect"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5215554/

相关文章:

c - 没有存档文件的静态链接如何工作?

c++ - 如何知道要在命令行中链接的库?

c++ - 尝试重写 jmp 时出现访问冲突异常

c++ - SFML/C++/Windows10 奇怪的消息?

c++ - MFC 列表框中的复选框在 VS2015 中显示不同

c++ - 有没有办法在旧版 C/C++ 编译器中使用 C++ 11 线程对象

c# - 将 Tortoise SVN 修订号链接到程序集版本

c++ - std::map 用于小型稀疏集合

c++ - Windows 消息循环

c++ - 链接到正确的库