Visual Studio"应用程序无法启动,因为应用程序配置不正确"错误

Pee*_*etP 3 c++ linker visual-studio-2010

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

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

应用程序无法启动,因为应用程序配置不正确"

在可执行文件上运行Dependency Walker显示无法找到msvcr90.dll,ieshishm.dll,ieframe.dllfreeglut.dll.我将这些复制到execs目录,解决了这些问题.但是,仍有两个问题:

错误:"e:\ projects\darwin\code\debug\GLTEMPLATE.EXE"的Side-by-Side配置信息包含错误.应用程序无法启动,因为它的并排配置不正确.请参阅应用程序事件日志或使用命令行sxstrace.exe工具获取更多详细信息(14001).警告:由于延迟加载相关模块中缺少导出功能,至少有一个模块具有未解析的导入.

将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.
(...)
Run Code Online (Sandbox Code Playgroud)

还有一些更相似.

我还尝试将多线程调试DLL(/ MDd)中的其他相关帖子的建议更改为多线程调试(/ MTd).但是,我得到了:

MSVCRTD.lib(MSVCR100D.dll):错误LNK2005:_printf已在LIBCMTD.lib(printf.obj)中定义

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

出了什么问题,我该如何解决这个问题?

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

Han*_*ant 5

您的项目使用一个或多个使用Visual Studio 2008(以前版本的Visual Studio)构建的库.它们需要该版本的C运行时库可用; 这就是为什么它抱怨msvcr90.dll.你有Visual Studio 2010; 您只在您的计算机上安装了msvcr100.dll.

只是复制msvcr90.dll是行不通的; 该DLL需要安装在Windows并排缓存中.您可以从Microsoft或您的朋友那里获得安装程序.然而,这不是真正的解决方案; 根据两个版本的CRT ,您的应用程序仍然存在问题.非常不健康,可能导致非常难以诊断的崩溃和内存泄漏.您需要使用Visual Studio 2010重建库.这就是我的建议失败的地方; 我无法猜出这些库来自你的问题.