2016-01-13 108 views
-1

我有一个x86 C++应用程序在VS2013中工作,我正在升级到VS2015。构建和连接工作正常,但是当我跑我得到一个错误:在VS2015建设给SideBySide错误

Unable to start program. This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors. Reinstalling the application may fix this problem. For more details, please see the application event log.

应用程序事件日志显示:

Activation context generation failed for "MyApp.exe". Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" could not be found. Please use sxstrace.exe for detailed diagnosis.

于是我就sxstrace,并得到:

================= 
Begin Activation Context Generation. 
Input Parameter: 
    Flags = 0 
    ProcessorArchitecture = Wow32 
    CultureFallBacks = en-US;en 
    ManifestPath = MyApp.exe 
    AssemblyDirectory = MyApp\Debug\ 
    Application Config File = 
----------------- 
INFO: Parsing Manifest File MyApp.exe. 
    INFO: Manifest Definition Identity is (null). 
    INFO: Reference: Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" 
INFO: Resolving reference Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762". 
    INFO: Resolving reference for ProcessorArchitecture WOW64. 
     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.VC80.DebugCRT\8.0.50727.762__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL. 
       INFO: Did not find manifest for culture Neutral. 
      INFO: End assembly probing. 
    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.VC80.DebugCRT\8.0.50727.762__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL. 
       INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT.DLL. 
       INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT.MANIFEST. 
       INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.DLL. 
       INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.MANIFEST. 
       INFO: Did not find manifest for culture Neutral. 
      INFO: End assembly probing. 
    ERROR: Cannot resolve reference Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762". 
ERROR: Activation Context generation failed. 
End Activation Context Generation. 

我'我不知道这是如何帮助,我仍然不明白为什么我得到这个错误,如果我在VS2015从头开始构建应用程序。我试过安装Microsoft Visual C++ 2005 SP1 Redistributable Package (x86),它对应的版本是8.0.50727.762,但没有帮助。

很多关于此主题的旧帖子(例如Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one?)都提到检查构建生成的.manifest文件,但找不到一个文件。 VS2015不再生成它们吗?

+0

您可能会链接到使用VS 2005编译的库,而您尝试编译和链接您的应用程序与VS 2015.该不兼容可能导致问题。你有图书馆的源代码吗?你可以做一个完整的重新编译和链接整个解决方案,包括你使用的任何库依赖项? –

+0

我确实有一些第三方库,但是为什么它在VS2013中工作,为什么不安装VS2005依赖关系帮助? – parsley72

+0

这两个,但静态链接的不是用VS2015构建的给出了一个链接器错误,直到我重建它们,所以他们没事。 – parsley72

回答

0

@ magicandre1981的回答是正确的,但没有给出任何线索如何帮助追踪它。我最终发现,当Visual Studio的链接我的应用程序它打印出:

glew32sd.lib(glew.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'glew32sd.lib(glew.obj)' or at 'MyApp\Debug\vc80.pdb'; linking object as if no debug info 

我从glew source code重建glew32sd.lib,我的问题是固定的。

0

你正在使用什么类型的3D方库,以及它们如何链接?例如,你使用的是DLL,Libs还是两者?如果您使用的是静态链接的第三方库,那么它们必须使用与您使用的相同版本的VS具有相同的代码生成标志进行编译和构建。您可能还想访问这些库的开发人员网站,并查看它们是否具有较新的版本,以及是否已使用当前版本的VS编译过的版本。如果他们只有2010,12或13他们应该工作,但你将不得不在2015年打开他们,并自己建立他们

例如;我使用libpng,openal,ogg-vorbis,glm & others,对于我的应用程序所依赖的所有第三方库,我已经创建了一个文件目录,并在其中存储了它们,并且在主机上创建了环境变量以实现更简单的链接过程。对于除了glm之外的所有这些库,因为glm是仅头文件库,所以我不得不为每个版本的Visual Studio创建不同的环境变量;例如OGG-Vorbis是用于做音频的2个不同的库;所以我会有OGG_SDK_2010,VORBIS_SDK_2010 ... OGG_SDK_2015,VORBIS_SDK_2015这些库是从他们的网站上的最新版本加载和构建出版本&每个版本的Visual Studio,我可能会使用的调试版本。

在我redid我的电脑之前,我确实有VS2008,2010,2012,2013和2015;现在我重新安装了我的操作系统,目前我只有VS2013 & 2015.因此,我的任何旧版VS2008,VS2010 & VS2012我都必须先将它们移植到2013年,并修复任何依赖关系并处理任何弃用。一旦这个过程完成,我就可以将它们移植到2015年。

现在,根据我从2013年起将我的一个程序移植到2015年的经验,有一点点过程必须是但是,我完全不记得我的头顶上究竟要做什么。我知道它确实需要一些时间来阅读不同的线索和试验和错误,以使一切正常工作。

这也可能是因为您可能正在使用尚未更新的库,并且目前没有更多的工作或支持正在进行,因此您可能会考虑使用的库依赖性可能会被视为已弃用如果是这样,那么你可能需要做一些研究来找到一个可以满足你需求的替代库。一旦找到合适的库,那么就需要删除所有旧的方法调用,并用对新库进行的等效调用来替换它们。但是,在某些情况下,这可能涉及对现有程序的完整重写。

例如;我使用OpenGL,当我第一次开始学习时,我使用的是1.0版本,其中用于渲染调用的所有内容都是在CPU上完成的。现在我在GPU上使用Modern OpenGL并使用GLSL着色器,并成功创建了3D图形着色器渲染引擎;从OpenGL 1.0到4.5的过渡相当有趣,OpenGL的相同库或API的两个版本之间的差异是一个挑战。从较旧版本的编译器移植到较新版本有时非常简单,就像从2012年到2013年的移植一样,并没有太多的开销改变,但有时从旧版本移植到新版本可能非常乏味,例如从2005年到2015年。

也不要忘记检查这些第三方库道具文件,以确保它们指向VS的正确版本。

1

一个您使用的库的建立是对VS2005的调试运行时(Microsoft.VC80。调试 CRT)。这些调试文件是不是正常Visual C++ 2005 SP1可再发行组件包的一部分。

做一个试验&错误搜索找出哪个库,并获得使用发行版本的发行版,它是可再发行组件包的一部分。

+0

问题是“试错法搜索”。我不相信有没有更好的方式来做到这一点! – parsley72

+0

DLL可以使用depends.exe,但我不知道如何检查.lib文件。 – magicandre1981